How to increase number of gunicorns workers

I want to change the number of gunicorns workers. I open common_site_config.json and change “gunicorn_workers”: 1 to “gunicorn_workers”: 4

{
 "db_host": "104.155.213.83",
 "auto_update": false,
 "background_workers": 4,
 "dns_multitenant": true,
 "frappe_user": "ccfiel",
 "gunicorn_workers": 4,
 "rebase_on_pull": false,
 "redis_cache": "redis://localhost:13000",
 "redis_queue": "redis://localhost:11000",
 "redis_socketio": "redis://localhost:12000",
 "restart_supervisor_on_update": true,
 "serve_default_site": true,
 "shallow_clone": true,
 "socketio_port": 9000,
 "update_bench_on_update": false,
 "webserver_port": 8000
}

I restart the vm but when I look at the process the gunicorn still has 1 worker

Any idea how to add gunicorn workers?

1 Like

I have notice the supervisor.conf in frappe is statically set the worker to 1. Is this intentional? Did I missed something? If this is the case what is the purpose of the config in common_site_config.json?

[program:frappe-bench-frappe-web]
command=/home/ccfiel/frappe-bench/env/bin/gunicorn -b 127.0.0.1:8000 -w 1 -t 120 frappe.app:application --preload

@ccfiel could be an issue

@anand can you check?

1 Like

@ccfiel after changing gunicorn workers, you need to run:

bench setup supervisor
sudo supervisorctl reread
sudo supervisorctl update
13 Likes

@anand Thanks a lot for the info!