I am wondering if somebody could inform me of the correct behaviour for a Rails app running through Rack/Passenger, as I am seeing some unusual behaviour on a production system which has never been running quite right.

My understanding is that Passenger will create instances of Rack to satisfy demand for a web application. The problem I have is that both Passenger and Rack processes disappear after a few minutes runtime. In this eventuality, the next request will restart both Passenger and Rack, but this can take upwards of 10 seconds.

When I look at the process list, I see that when things are working well I have at least one instance of "Rack: /my_application". I also have "Passenger ApplicationSpawner" running.

ApplicationSpawner seems to disappear after about 10 minutes, and the Rack instances sometimes disappear as well. I sometimes end up with no Rack processes or an ApplicationSpawner, so the next request takes ages.

Any ideas as to how to correct this?


That's intended (and even, some say, desired) behaviour on Passenger's part. It likes to prune unused appserver workers so that the RAM is available for other things if necessary. You can adjust Passenger's behaviour with PassengerMinInstances and/or PassengerPoolIdleTime.

  • Certainly isn't desired for me to have users waiting up to 10 seconds for a page request...sorry for being dumb but where would I find PassengerMinInstances? – KingyCronus Aug 7 '12 at 8:56
  • In the manual, which I linked to in my answer. – womble Aug 7 '12 at 9:01
  • Oh so sorry, I am colourblind and missed the links! – KingyCronus Aug 7 '12 at 9:04
  • should it also be the case that Passenger ApplicationSpawner is closed? The application spawner itself appears to be closing after a time. (See my edit in question) – KingyCronus Aug 7 '12 at 11:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.