More work on configs and env

This commit is contained in:
Scott Idem
2023-09-08 14:23:08 -04:00
parent be1bb21b7e
commit 9262e9987e
3 changed files with 20 additions and 12 deletions

View File

@@ -22,9 +22,9 @@ wsgi_app = "app.main:app"
# default_proc_name = "app.main:app"
# Setting a long timeout since some FastAPI API requests may take a while
timeout = 2100 # default 30; 1200 is NOT enough; worker process silent then kill and restart
graceful_timeout = 20 # default 30; timeout after restart signal; tried 10 2023-07-11
keepalive = 30 # default 2; setting higher because behind load balancer (nginx); tried 10 2023-07-11
timeout = os.getenv('AE_API_GUNICORN_TIMEOUT', 2100) # default 30; 1200 is NOT enough; worker process silent then kill and restart
graceful_timeout = os.getenv('AE_API_GUNICORN_GRACEFUL_TIMEOUT', 20) # default 30; timeout after restart signal; tried 10 2023-07-11
keepalive = os.getenv('AE_API_GUNICORN_KEEPALIVE', 30) # default 2; setting higher because behind load balancer (nginx); tried 10 2023-07-11
# Reload does not work correctly with UvicornWorker
# https://github.com/benoitc/gunicorn/issues/2339
@@ -37,7 +37,7 @@ 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', 2)
threads = os.getenv('AE_API_THREADS', 2)
workers = os.getenv('AE_API_GUNICORN_WORKERS', 2)
threads = os.getenv('AE_API_GUNICORN_THREADS', 2)
# umask = '007'

View File

@@ -22,9 +22,9 @@ wsgi_app = "run_server:app"
# default_proc_name = "run_server:app"
# Setting a longer timeout since some Flask app requests may take a while
timeout = 1200 # default 30; worker process silent then kill and restart
graceful_timeout = 20
keepalive = 300 # default 2; setting higher because behind load balancer (nginx)
timeout = os.getenv('AE_APP_GUNICORN_TIMEOUT', 1200) # default 30; worker process silent then kill and restart
graceful_timeout = os.getenv('AE_APP_GUNICORN_GRACEFUL_TIMEOUT', 20)
keepalive = os.getenv('AE_APP_GUNICORN_KEEPALIVE', 300) # default 2; setting higher because behind load balancer (nginx)
# Disable reload if using more than one thread
reload = True
@@ -33,8 +33,8 @@ reload = True
# 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_APP_WORKERS', 2)
threads = os.getenv('AE_APP_THREADS', 2)
workers = os.getenv('AE_APP_GUNICORN_WORKERS', 2)
threads = os.getenv('AE_APP_GUNICORN_THREADS', 2)
# umask = '007'