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 GIL. However, a multiprocess mode is available so that concurrent requests can be handled. The option workers=N
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 processors. The best setting to use needs to be tuned for each case, since it depends on the server load and what other load intensive services are running on the server, such as PostgreSQL.
It is better to set workers too high for the load than too low. The minimum should be 6 due to the parallel connections used by most browsers, and the maximum is generally be limited by the amount of RAM on the machine.
There a few limit-*
config parameters to tune the workers. Workers are recycled when they reach these limits—the corresponding process is stopped...