import os # Gunicorn config variables loglevel = "warning" accesslog = "/logs/gunicorn_access.log" # "-" # stdout errorlog = "/logs/gunicorn_error.log" # "-" # stderr # "logfile" does not seem to actually do anything # logfile = "/logs/gunicorn.log" # "-" # stderr bind = "0.0.0.0:5005" # bind = "unix:/tmp/gunicorn.sock" worker_tmp_dir = "/dev/shm" chdir = "/srv/aether_api" # home = /path/to/environment wsgi_app = "app.main:app" # module = "run_server" # callable = "app" # plugins = "python" # default_proc_name = "app.main:app" # Setting a long timeout since some FastAPI API requests may take a while timeout = 1200 # default 30; worker process silent then kill and restart graceful_timeout = 20 # default 30; timeout after restart signal keepalive = 300 # default 2; setting higher because behind load balancer (nginx) # Reload does not work correctly with UvicornWorker # https://github.com/benoitc/gunicorn/issues/2339 # Disable reload if using more than one thread reload = True # reload_engine = "poll" worker_class = "uvicorn.workers.UvicornWorker" # default "sync" # Works are processes, not threads # workers = 9 # default 1; use 10ish for production; 2 to 4 times the number of cores # threads = 1 # default 1; only affects Gthread worker type workers = os.getenv('AE_API_WORKERS', None) threads = os.getenv('AE_API_THREADS', None) # umask = '007'