Gunicorn
The Gunicorn web server is built to scale with increasing request loads. The master process creates child processes that handle each request. Another advantage is that when a request crashes, the master process remains unaffected. The forks are created before the request comes in. The number of worker processes can be set when Gunicorn is started. Four to twelve worker processes are able to handle thousands of requests per second. The operating system does the load balancing of the worker processes. The number of worker processes to use depends on the use case; it is recommended to start with (2x the number of CPU cores + 1) worker processes and then modify this based on production usage. There are two types of workers: sync and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access