Automation: Final robust DB restore fixes and updated gitignore rules.
This commit is contained in:
@@ -3,44 +3,25 @@ import os
|
||||
# Gunicorn config variables
|
||||
loglevel = os.getenv('AE_LOG_LVL', '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
|
||||
accesslog = "-" # stdout
|
||||
errorlog = "-" # stderr
|
||||
|
||||
# ... (existing bind/chdir) ...
|
||||
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 = os.getenv('AE_API_GUNICORN_TIMEOUT', 30) # default 30; 1200 is NOT enough; worker process silent then kill and restart
|
||||
graceful_timeout = os.getenv('AE_API_GUNICORN_GRACEFUL_TIMEOUT', 30) # default 30; timeout after restart signal; tried 10 2023-07-11
|
||||
keepalive = os.getenv('AE_API_GUNICORN_KEEPALIVE', 4) # default 2; not used with sync workers; setting higher because behind load balancer (nginx); tried 10 2023-07-11
|
||||
# Numeric variables must be integers
|
||||
timeout = int(os.getenv('AE_API_GUNICORN_TIMEOUT', 30))
|
||||
graceful_timeout = int(os.getenv('AE_API_GUNICORN_GRACEFUL_TIMEOUT', 30))
|
||||
keepalive = int(os.getenv('AE_API_GUNICORN_KEEPALIVE', 4))
|
||||
|
||||
# Reload does not work correctly with UvicornWorker
|
||||
# https://github.com/benoitc/gunicorn/issues/2339
|
||||
# Disable reload if using more than one thread
|
||||
reload = False
|
||||
worker_class = "uvicorn.workers.UvicornWorker"
|
||||
|
||||
# reload_engine = "poll"
|
||||
workers = int(os.getenv('AE_API_GUNICORN_WORKERS', 2))
|
||||
threads = int(os.getenv('AE_API_GUNICORN_THREADS', 2))
|
||||
|
||||
worker_class = "uvicorn.workers.UvicornWorker" # default "sync"
|
||||
# worker_class = "gthread"
|
||||
# worker_class = "aiohttp.worker.GunicornWebWorker"
|
||||
# worker_class = "gevent" # for gthread?
|
||||
# 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_GUNICORN_WORKERS', 2)
|
||||
threads = os.getenv('AE_API_GUNICORN_THREADS', 2)
|
||||
|
||||
# umask = '007'
|
||||
|
||||
1
conf/crontab
Normal file
1
conf/crontab
Normal file
@@ -0,0 +1 @@
|
||||
55 * * * * bash /scripts/backup_internal.sh >> /logs/backup_cron.log 2>&1
|
||||
Reference in New Issue
Block a user