Multiprocessing workers
A production instance is expected to handle a significant workload. By default, the server runs one process and can use only one CPU core for processing, because of the Python language Global Interpreter Lock (GIL). However, a multiprocess mode is available so that concurrent requests can be handled, taking advantage of multiple cores.
The workers=N option sets the number of worker processes to use. As a guideline, you can try setting it to 1+2*P, where P is the number of processor cores. The best setting to use needs to be tuned for each case, as it depends on the server load and what other load-intensive services are running, such as PostgreSQL.
It's better to set workers that are too high for the load than too ...
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