I've spun up a local kubernetes cluster containing...
# general
r
I've spun up a local kubernetes cluster containing a django app run via a pex file. Startup times are close to 15 minutes. I've set execution_mode to
venv
which seems to have reduced times to 5 minutes. Not using pex files (just python manage.py ...) seems to reduce startup times to around 30 seconds. Does anyone have any tips on making things faster with pex files? I rather stick with pex files as local development is leveraging them.
b
That blog post is good for solving pex-in-docker. As a meta point, if you set
PEX_VERBOSE=1
environment variable (or higher numbers) you can get a sense of where time is being spent, which may or not help optimise.
r
Interesting, there's definitely stuff happening. I see a bunch of: 1.
Laying out Spread PEX directory
, followed by a bunch of 2.
Installing zipped wheel install
, then a bunch of 3.
Executing installed PEX for
, and then another bunch of 4.
Re-writing
, and finally 5. app is run
That's with
PEX_VERBOSE=1
Looking into compiling during build time
Down to 45 seconds using a simple multi-stage build
🎉 1
👍 1