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 have a pretty simply passenger installation on my production server. It seems that every night the passenger process quits due to inactivity.

When I hit the site in the morning, passenger starts up again and will give me a fairly straightforward error that the 'sinatra' rubygem could not be loaded. When I refresh the page, the problem goes away and passenger works fine for the rest of the day.

Sinatra is a readily available gem, and I load it in after I require 'rubygems.' Any idea why passenger would fail to launch on the first try?

share|improve this question
    
is there anything relevant in the apache error logs? –  Zypher Mar 22 '12 at 19:32
    
There are no apache errors –  Andy Mar 22 '12 at 19:45

1 Answer 1

Passenger stays up the whole time, but it'll allow the Rack processes which are the part executing your code to shutdown after a length of inactivity. The simplest solution is to keep at least one Rack process running. Assuming Passenger 3.x you can add this to your vhost or passenger config.

PassengerMinInstances 1
share|improve this answer
    
Unfortunately I am running 2.2.9-2. Would restart clear all the rack processes as well? Curiously, restarting the app will not cause passenger to break. –  Andy Mar 22 '12 at 22:52
    
In my experience you would normally wait for Passenger to start the app and you'll get a page after half a minute or so. However I started with version 2.2.11 and went to 3.x pretty quickly. It may be a bug of some sort.Which distro are you on? There are packages for yum/apt distros. Passenger 3 is really worth the upgrade. –  kashani Mar 22 '12 at 23:05
    
Have you tried using PassengerPreStart directive ? –  Shyam Sundar C S Mar 28 '12 at 7:26
    
IIRC PassengerPreStart is only available in 3.0 and up. –  kashani Mar 28 '12 at 16:51

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.