Optimizing Gunicorn

I’m seeing some worker time outs and strange resource spikes with a gunicorn based app, and looking into it I’m starting to wonder if there’s some alterations to the default gunicorn run command that might be helpful on render. Configuring Gunicorn for Docker

I’m going to try these and I’ll update this thread w/ results, but if anyone has done this before or has a suggestion please chime in!

Seems to be working better - I think the number of workers is lowered from 4 to 2, which is why the resting memory use is lower, but I am not getting any timeouts/crashing workers anymore

the updated command is:
gunicorn --worker-tmp-dir /dev/shm --workers=2 --threads=4 --worker-class=gthread --log-file=- <application_path>

1 Like