3

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?

Andy
  • 31
  • 1

1 Answers1

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
kashani
  • 3,922
  • 18
  • 18
  • 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 07:26
  • IIRC PassengerPreStart is only available in 3.0 and up. – kashani Mar 28 '12 at 16:51