Search code examples
ruby-on-railspassengerfusion

Control the number of processes with Phusion Passenger?


I have one rails app run with Phusion Passenger as a standalone server with the command bundle exec passenger start --port 8000 --user ubuntu --daemonize.

The issue is that Passenger launches too many processes for my work and consumes quite a lot of memory. The server is used for my private work, so there is almost no service request. How can I control the number of processes with Phusion Passenger? What configuration option should be minimum in memory consumption?

enter image description here

Edit

With --max-pool-size 1, I don't see dramatic improve; I still have multiple RubyApp and preloaders.

enter image description here

Edit 2 (working with nginx)

From https://www.phusionpassenger.com/documentation/Users%20guide%20Nginx%203.0.html I could learn more about the options that I can add to nginx.conf file.

passenger_max_pool_size 1;
passenger_pool_idle_time 1;

passenger-status shows much less memory usage (only one pool).

buntu@ip-172-31-63-19 public> sudo passenger-status
Version : 5.0.21
Date    : 2015-11-06 05:50:24 +0000
Instance: aSCyt3IW (nginx/1.8.0 Phusion_Passenger/5.0.21)

----------- General information -----------
Max pool size : 1
App groups    : 1
Processes     : 1
Requests in top-level queue : 0

----------- Application groups -----------
/home/ubuntu/webapp/rails/passenger-ruby-rails-demo/public (development):
  App root: /home/ubuntu/webapp/rails/passenger-ruby-rails-demo
  Requests in queue: 0
  * PID: 3099    Sessions: 0       Processed: 49      Uptime: 33s
    CPU: 1%      Memory  : 69M     Last used: 11s ago

Solution

  • Try this:

    passenger start --max-pool-size <NUMBER>