I played a bit - ‘bench setup supervisor’ seems to simply set the config/supervisor.conf default values!? I would need to check where these are read from…
For eg. this default
command=/home/frappe/frappe-bench/env/bin/gunicorn -b 127.0.0.1:8000 -w 1 -t 120 frappe.app:application --preload
So I simply directly edited config/supervisor.conf to set -w to 2 for eg.
command=/home/frappe/frappe-bench/env/bin/gunicorn -b 127.0.0.1:8000 -w 2 -t 120 frappe.app:application --preload
Then ran these:
sudo supervisorctl reread
sudo supervisorctl update
Then restarted the supervisor with this:
sudo supervisorctl stop all
sudo supervisorctl start all
Then confirm the results like this:
less logs/web.error.log
[2017-09-16 05:40:17 +0000] [19289] [INFO] Shutting down: Master
[2017-09-16 05:40:20 +0000] [19349] [INFO] Starting gunicorn 19.6.0
[2017-09-16 05:40:20 +0000] [19349] [INFO] Listening at: http://127.0.0.1:8000 (19349)
[2017-09-16 05:40:20 +0000] [19349] [INFO] Using worker: sync
[2017-09-16 05:40:20 +0000] [19366] [INFO] Booting worker with pid: 19366
[2017-09-16 05:40:20 +0000] [19367] [INFO] Booting worker with pid: 19367
ps aux | grep gunicorn
frappe@erpnext:~/frappe-bench$ ps aux | grep gunicorn
frappe 19349 0.0 2.3 33440 23988 ? S 05:40 0:01 /home/frappe/frappe-bench/env/bin/python /home/frappe/frappe-bench/env/bin/gunicorn -b 127.0.0.1:8000 -w 2 -t 120 frappe.app:application --preload
frappe 19366 0.0 2.0 33440 21232 ? S 05:40 0:00 /home/frappe/frappe-bench/env/bin/python /home/frappe/frappe-bench/env/bin/gunicorn -b 127.0.0.1:8000 -w 2 -t 120 frappe.app:application --preload
frappe 19367 0.0 2.4 35712 25244 ? S 05:40 0:00 /home/frappe/frappe-bench/env/bin/python /home/frappe/frappe-bench/env/bin/gunicorn -b 127.0.0.1:8000 -w 2 -t 120 frappe.app:application --preload
frappe 19629 0.0 0.0 4680 840 pts/0 S+ 06:47 0:00 grep --color=auto gunicorn
frappe@erpnext:~/frappe-bench$
I am not sure why there are 3 gunicorn processs here?
hth