From 7161328f4f334b36b0730d6d26b7660bd9c590c2 Mon Sep 17 00:00:00 2001 From: charnesp Date: Fri, 16 Apr 2021 18:16:40 +0200 Subject: [PATCH] Add workers number on Gunicorn Add optimum workers number on Gunicorn, based on cpu numbers (https://docs.gunicorn.org/en/stable/design.html) --- start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start.sh b/start.sh index dc2a81f2..83dbc788 100755 --- a/start.sh +++ b/start.sh @@ -140,7 +140,7 @@ else congrats nginx -c $(pwd)/nginx/$conf - gunicorn webodm.wsgi --bind unix:/tmp/gunicorn.sock --timeout 300000 --max-requests 250 --preload + gunicorn webodm.wsgi --bind unix:/tmp/gunicorn.sock --timeout 300000 --max-requests 250 --workers $((2*$(grep -c '^processor' /proc/cpuinfo)+1)) --preload fi # If this is executed, it means the previous command failed, don't display the congratulations message