Mauricio
Mauricio

Reputation: 3079

Gunicorn worker doesn't deflate memory after request

I have a single gunicorn worker process running to read an enormous excel file which takes up to 5 minutes and uses 4GB of RAM. But after the request was finished processing I noticed at system monitor that it stills allocating 4GB of RAM forever. Any ideas on what to do to release the memory?

Upvotes: 9

Views: 8855

Answers (1)

praneeth
praneeth

Reputation: 482

You may try setting the --max-requests (N) parameter for a Gunicorn worker to indicate to restart the worker after processing N number of requests.

You can refer for more on the --max-requests settings here: http://docs.gunicorn.org/en/stable/settings.html

Upvotes: 10

Related Questions