Skip to content

Instantly share code, notes, and snippets.

@pavank
Created May 28, 2019 09:36
Show Gist options
  • Save pavank/e6440de17d3c24c07faae0fab0640e0d to your computer and use it in GitHub Desktop.
Save pavank/e6440de17d3c24c07faae0fab0640e0d to your computer and use it in GitHub Desktop.
Gunicorn Config
"""gunicorn WSGI server configuration."""
from multiprocessing import cpu_count
from os import environ
def max_workers():
return cpu_count() * 2 + 1
# Config Properties
bind = '0.0.0.0:' + environ.get('PORT', '8080')
max_requests = 1000
worker_class = 'aiohttp.GunicornWebWorker'
workers = 1 # commet this line for prod
# workers = max_workers() #uncomment this line for prod
accesslog = '-'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment