I have a rails server running under nginx & passenger. My sheduler.rb
looks like this
require \'rufus-scheduler\'
my_awesome_job = Rufus::Schedu
So, I found the answer here
I've added these two lines in nginx.conf
(after passenger_enabled on;
):
rails_app_spawner_idle_time 0;
passenger_min_instances 1;
That keeps one passenger thread active.
Most likely, this problem is caused by the Rufus scheduler background thread being terminated after Phusion Passenger spawns a child process as part of the smart spawning method.
Read Spawning methods explained. The specific issue you're suffering from is probably Smart spawning caveat #2: the need to revive threads.
You need to revive the Rufus scheduler thread using the mechanism in the documentation. I'm not exactly sure which API call you need to make, so maybe you can ask the Rufus scheduler authors.
Alternatively, you can use the 'direct' spawning method. It's less efficient but it avoids compatibility issues like this.