简体   繁体   English

Gunicorn增加了内存RAM

[英]Gunicorn increases memory RAM

I have a service in docker that worked Gunicorn. 我在工作Gunicorn的Docker中有一项服务。 Everything works correctly, except RAM consumption, which increases since the service is fixed until it is restarted. 一切正常,除了RAM消耗,由于服务固定,直到重新启动,这会增加RAM消耗。

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. 我的问题是,如果有人知道可以做什么,是否在我的Gunicorn中配置了错误的内容,或者是否存在增加RAM内存的解决方案。

Thanks for your attention. 感谢您的关注。

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. 一个对我有用的解决方案是为gunicorn worker设置max-requests参数,该参数可确保在处理指定数量的请求后重新启动该worker。 You can check more at http://docs.gunicorn.org/en/stable/settings.html 您可以在http://docs.gunicorn.org/en/stable/settings.html中查看更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM