How to limit Phusion Passenger memory usage?

送分小仙女□ 提交于 2019-12-12 08:25:48

问题


Is there a way to limit the amount of memory Phusion Passenger uses when serving up your app?

My host comes by and kills the process after I get a bunch of traffic and so I end up serving up blank pages. Is there anything I can do to say "hey don't use any more than 100Mb and only spawn 3 processes no matter how overloaded the site is"


回答1:


There is no way to limit the memory usage explicitly (say use <= 100MiB).

But what you can do is limit the number of processes by setting PassengerMaxPoolSize. Set that and then see how is the memory usage (that depends on the apps you are running).

Also, using Ruby Enterprise Edition may help.




回答2:


Also check out passenger_max_requests, new in 3.0.11

http://www.modrails.com/documentation/Users%20guide%20Nginx.html#PassengerMaxRequests




回答3:


appears it may have been "implemented in passenger enterprise" https://code.google.com/p/phusion-passenger/issues/detail?id=201




回答4:


To complement what Mihai A wrote in 2009, REE has reached end of life in 2012. One of the main reasons being that it does not offer a significant performance improvment over Ruby 2.0.




回答5:


As others pointed out, the Enterprise version of passenger has this feature.

For the free version, check out this blog post: http://dev.mensfeld.pl/2012/08/simple-rubyrails-passenger-memory-consumption-limit-monitoring/




回答6:


Try running it in a Solaris Zone ;)



来源:https://stackoverflow.com/questions/474147/how-to-limit-phusion-passenger-memory-usage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!