Open
Description
It seems like there is a bug in initialization logic.
Gunicorn processes are initialized not at container start but at a time of first request arrival.
The global app
variable here is not shared between gunicorn processes, so each process will be initialized only at a request arrival.
This will cause a random behavior. If the request comes to a worker that was already initialized - it will be processed quickly. If the request comes to a worker that is not yet initialized - the response will be delayed for quite some time (>30 sec in my case).
This will even cause /ping
requests to time out and inability to deploy a container to AWS.