common_config.py - common gunicorn configuration settings

This file contains common configuration settings for gunicorn.

See also the gunicorn config docs.

Imports

These are listed in the order prescribed by `PEP 8`_.

Standard library

None.

Third-party imports

None.

Local application imports

None.

Configuration

user: Switch worker processes to run as this user.

user = "www-data"
 

group: Switch worker process to run as this group.

group = "www-data"
 

max_requests: The maximum number of requests a worker will process before restarting. This is a good way to prevent memory “leaks” in Python to keep things from eventually crashing.

max_requests = 5000
 

max_requests_jitter: The maximum jitter to add to the max_requests setting. Ensures that everything doesn’t restart in lock step.

max_requests_jitter = 30
 

timeout: Workers silent for more than this many seconds are killed and restarted. Restart processes that haven’t produced any output for 60 seconds.

timeout = 60