Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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