Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to limit Phusion Passenger memory usage?

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"

like image 266
joebob Avatar asked Jan 23 '09 19:01

joebob


People also ask

How do I stop Phusion Passenger?

Stopping the server There are two ways to stop the server. The first is by pressing Ctrl-C in the terminal. The second way is by running passenger stop .

What does Phusion Passenger do?

Phusion Passenger® is an open source web application server. It handles HTTP requests, manages processes and resources, and enables administration, monitoring and problem diagnosis. Passenger is very easy to use, makes deploying in production much easier and is scalable.


2 Answers

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.

like image 133
Mihai A Avatar answered Sep 22 '22 08:09

Mihai A


Also check out passenger_max_requests, new in 3.0.11

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

like image 45
esilver Avatar answered Sep 24 '22 08:09

esilver