5

I have a service in docker that worked Gunicorn. Everything works correctly, except RAM consumption, which increases since the service is fixed until it is restarted.

My question is if someone knows what can be done, if there is something wrong configured in my Gunicorn or if there is a solution to increase RAM memory.

Thanks for your attention.

1
  • We are experiencing a similar issue. Gunicorn workers hold a big chunk of memory to face a high work load, does not free it (even setting the --max-requests parameter) and for a second test the performance gets way worst. Commented Jan 16, 2021 at 15:25

1 Answer 1

7

That seems to be an expected behavior from gunicorn. I too faced a similar situation where the memory consumed by each worker would increase over time. One solution that worked for me was setting the max-requests parameter for a gunicorn worker which ensures that a worker is restarted after processing a specified number of requests. You can check more at http://docs.gunicorn.org/en/stable/settings.html

1
  • any suggestions for --max-requests number ? like 10, 100 or 1000 ? I have 1 GB RAM server and work load1000 request daily . Thanks Commented Jan 3 at 9:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.