Compile bytecode into the image (boot-time health check misses) #136
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
CrowderSoup/vTodo!136
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "claude/precompile-bytecode"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The first deploy of #135 failed its health check. Pyroscope's profile of that container explains why: each gunicorn worker spent about 12 s of CPU compiling Python source at boot, because the image has no
.pycfiles andPYTHONDONTWRITEBYTECODEkeeps them from being written. That boot ran while vPages was building on the droplet, and it missed kamal-proxy's 30 s limit. The re-run succeeded once the droplet was quiet.This compiles the venv and the app at build time with
compileall. Locally, importing the app drops from 1.8 s to 0.9 s, and the image built from a cleangit archivehas 4,256.pycfiles.🤖 Generated with Claude Code