gunicorn.pyΒΆ

The gunicorn.py file is created automatically by deploybuilder and is located in the site configuration folder.

A typical file is composed as follows:

bind = 'unix:/home/ubuntu/gitrepos/genropynet/projects/genropynet/sites/genropynet/sockets/gunicorn.sock'
pidfile = '/home/ubuntu/gitrepos/genropynet/projects/genropynet/sites/genropynet/genropynet_pid'
demon = False
accesslog = '/home/ubuntu/gitrepos/genropynet/projects/genropynet/sites/genropynet/logs/access.log'
errorlog = '/home/ubuntu/gitrepos/genropynet/projects/genropynet/sites/genropynet/logs/error.log'
logfile = '/home/ubuntu/gitrepos/genropynet/projects/genropynet/sites/genropynet/logs/main.log'
workers = 5
loglevel = 'error'
chdir = '/home/ubuntu/gitrepos/genropynet/projects/genropynet/sites/genropynet'
reload = False
capture_output = True
worker_class = 'gevent'
maximum_requests = 300
max_requests_jitter = 50
expiry = 1800
graceful_timeout = 600

The parameters we can modify are:

  • worker: how many processes we want to use to serve the site

  • max_requests: The number of requests served before a process starts automatically

  • max_requests_jitter: modifies for each process the value of the previous parameter with a random number between 0 and the set value