uWSGI webserver takes way too long to restart on prod

I have started using uWSGI as a web server for my flask application.
I did this for a seamless deploy (no down time)
my uWSGI version is uWSGI==2.0.10

  1. I simulated on localhost and restarted using kill -HUP cat master.pid and it restarts instantly.
  2. on production it takes about a minute (which is a lot ) to start getting new requests after this message:


Gracefully killing worker 8 (pid: 16498)...
...gracefully killing workers...
Gracefully killing worker 1 (pid: 16491)...
Gracefully killing worker 2 (pid: 16492)...
.....
Gracefully killing worker 7 (pid: 16497)...
Gracefully killing worker 8 (pid: 16498)...


Source: python

Leave a Reply