From: Guillaume Pellerin Date: Tue, 29 Jun 2021 22:18:40 +0000 (+0200) Subject: try unix socket X-Git-Tag: 2.1~8^2~3 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=21fa3484c2b43f7cecde0fac8941d45bc32b5603;p=teleforma.git try unix socket --- diff --git a/app/wsgi.ini b/app/wsgi.ini index 32a8854c..98f5db96 100644 --- a/app/wsgi.ini +++ b/app/wsgi.ini @@ -1,9 +1,10 @@ [uwsgi] -socket = 0.0.0.0:8000 +socket = /srv/app/wsgi.socket chdir = /srv/app/ module = wsgi touch-reload = /srv/app/wsgi.py +chmod-socket = 664 uid = www-data gid = www-data @@ -29,7 +30,7 @@ reload-on-rss = 2048 ; Restart workers after this much resident worker-reload-mercy = 60 ; How long to wait before forcefully killing workers cheaper-algo = busyness -processes = 28 ; Maximum number of workers allowed +processes = 28 ; Maximum number of workers allowed cheaper = 8 ; Minimum number of workers allowed cheaper-initial = 16 ; Workers created at startup cheaper-overload = 1 ; Length of a cycle in seconds @@ -37,7 +38,7 @@ cheaper-step = 4 ; How many workers to spawn at a time cheaper-busyness-multiplier = 30 ; How many cycles to wait before killing workers cheaper-busyness-min = 20 ; Below this threshold, kill workers (if stable for multiplier cycles) -cheaper-busyness-max = 90 ; Above this threshold, spawn new workers +cheaper-busyness-max = 70 ; Above this threshold, spawn new workers cheaper-busyness-backlog-alert = 16 ; Spawn emergency workers if more than this many requests are waiting in the queue cheaper-busyness-backlog-step = 2 ; How many emergency workers to create if there are too many requests in the queue diff --git a/docker-compose.yml b/docker-compose.yml index 267fe545..24660754 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,6 +17,7 @@ services: - ./var/static:/srv/static - ./var/log/app:/var/log/app - ./var/log/uwsgi:/var/log/uwsgi + - ./app/wsgi.socket:/srv/app/wsgi.socket links: - postgres - redis