11

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"

John Topley
  • 113,588
  • 46
  • 195
  • 237
joebob
  • 143
  • 1
  • 8

6 Answers6

6

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.

Kevin Sylvestre
  • 37,288
  • 33
  • 152
  • 232
Mihai A
  • 1,471
  • 8
  • 12
  • 1
    For what it's worth, this is no-longer true (in 2015). If you are using Passenger Enterprise 5.0+ you can set PassengerMemoryLimit: https://www.phusionpassenger.com/library/config/apache/reference/#passengermemorylimit – Derek Prior Aug 18 '15 at 23:50
  • This actually won't help because you need more servers rather then more memory on this server. Its like an equation where you have to decide what to optimize: response time or costs – YoMan78 Jul 31 '18 at 16:48
2

Also check out passenger_max_requests, new in 3.0.11

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

esilver
  • 27,713
  • 23
  • 122
  • 168
0

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

rogerdpack
  • 62,887
  • 36
  • 269
  • 388
0

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.

Antoine M.
  • 18
  • 3
0

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/

Dan Mazzini
  • 1,005
  • 10
  • 19
-3

Try running it in a Solaris Zone ;)

  • 2
    awn -1. "Change to another platform" should be always a very evident or very argumented answer – theist Dec 15 '11 at 23:32