I did the following enhancements to Gunicorn:
- Upgraded gunicorn to 20.0.04 (Current version is 19.10.0)
- Added the thread parameters to gunicorn at supervisor.conf to improve efficiency of gunicorn workers
- Threads: --threads 10 (recommended value is 2 to 4 num_cores x 2.
(Note: -w 4 (recommended gunicorn value is 2 x num_cores + 1)
- Assigned the gunicorn heartbeat filesystem to memory based instead of disk-based (Ubuntu 18).
- –worker-tmp-dir /dev/shm
I am happy to note that there is a noticeable snappiness in the response of ERPNext.
(This is only for those who understand the production mode well, because messing with generated conf files may get messy if you don’t know your way.)