Phusion Passenger PassengerMaxPoolSize is ignored

I’ve been wondering for a while why Phusion Passenger seems to completely ignore the PassengerMaxPoolSize, PassengerMaxInstancesPerApp and PassengerPoolIdleTime directives. I recently discovered that they don’t work inside VirtualHost blocks in apache config. The old (non-working) config was something like :

<VirtualHost *:8080> 
    ServerName recurser.com 
    ServerAlias www.recurser.com 
 
    DocumentRoot /var/www/recurser.com 
    # My rails app is served from the /code/ subfolder of my main domain
    RailsBaseURI /code
    PassengerMaxPoolSize 3
    PassengerMaxInstancesPerApp 2
    PassengerPoolIdleTime 120
    # I use Ruby Enterprise Edition (http://www.rubyenterpriseedition.com/)
    # You can remove the following line if you use regular ruby
    PassengerRuby /opt/ruby-enterprise-1.8.6-20080810/bin/ruby
    ...
    ...
</VirtualHost>

When i moved the directives outside the VirtualHost block, everything worked as advertised :

PassengerMaxPoolSize 3
PassengerMaxInstancesPerApp 2
PassengerPoolIdleTime 120
# I use Ruby Enterprise Edition (http://www.rubyenterpriseedition.com/)
# You can remove the following line if you use regular ruby
PassengerRuby /opt/ruby-enterprise-1.8.6-20080810/bin/ruby
 
<VirtualHost *:8080> 
    ServerName recurser.com 
    ServerAlias www.recurser.com 
 
    DocumentRoot /var/www/recurser.com 
    # My rails app is served from the /code/ subfolder of my main domain
    RailsBaseURI /code
    ...
    ...
</VirtualHost>

You can check what passenger is doing by looking inside the /tmp/passenger_status.* file on your system (the filename will vary depending on your system). :

----------- General information -----------
max      = 3
count    = 1
active   = 0
inactive = 1
 
----------- Applications -----------
/var/www/code.recurser.com: 
  PID: 14494     Sessions: 0



3 Responses to “Phusion Passenger PassengerMaxPoolSize is ignored”  

  1. 1 Sebastian

    thanks a lot for the info! I kept wondering, why I still had these aweful long startup times, although I had set PassengerPoolIdleTime in my VirtualHost config file. Now I know :-)

  2. 2 Dave

    Thanks for the info. However, while I find that passenger-status returns the right thing, if I look at top’s output, I always end up with 1 extra process. Have you seen this?

  3. 3 Brennan

    Thanks for the post! It was driving me batty, since I put them in a separate .conf file with an include in the VirtualHost block. I moved the include outside the block and voila! They should change and clarify the docs.

Leave a Reply