Server Stuff
How do I reload my application in Gunicorn?
You can gracefully reload by sending HUP signal to gunicorn:
$ kill -HUP masterpid
How might I test a proxy configuration?
The Hey program is a great way to test that your proxy is correctly buffering responses for the synchronous workers:
$ hey -n 10000 -c 100 http://127.0.0.1:5000/
This runs a benchmark of 10000 requests with 100 running concurrently.
How can I name processes?
If you install the Python package setproctitle Gunicorn will set the process names to something a bit more meaningful. This will affect the output you see in tools like ps
and top
. This helps for distinguishing the master process as well as between masters when running more than one app on a single machine. See the proc_name setting for more information.
Why is there no HTTP Keep-Alive?
The default Sync workers are designed to run behind Nginx which only uses HTTP/1.0 with its upstream servers. If you want to deploy Gunicorn to handle unbuffered requests (ie, serving requests directly from the internet) you should use one of the async workers.