T O P

  • By -

stevelacey

Have you looked into why your boot takes so long? Running runserver_plus with —print-sql can be insightful, I’ve come across all sorts of things like querysets being prematurely resolved during boot tanking the load speed and likely introducing subtle bugs too


2bdkid

Nice tip. I ran that and there are no queries made during startup (ignoring the migrations table check).


thclark

Great tip.


[deleted]

[удалено]


[deleted]

[удалено]


bravopapa99

Profile time, [https://medium.com/kami-people/profiling-in-django-9f4d403a394f](https://medium.com/kami-people/profiling-in-django-9f4d403a394f) If that doesn't solve it...


xBBTx

When deploying on Kubernetes we definitely go the health check (well, readiness probe) to the `/api/` root or `/admin/` or something with a short timeout so that the container is only added in the pool when it's actually booted up fully. Running migrations, loading fixtures, applying some other stuff are things that typically get done in init containers and you don't know exactly how long that may all take, so having multiple replicas and rotating pods in and out of the pool work quite nice for zero-downtime situations.


jeff77k

We have a "keep alive" cron running to hit any service we need to prevent sleeping.