The only way I know to handle this is by hacking your dispatch.fcgi.
This is a real problem on Dreamhost.
require File.dirname(FILE) + “/…/config/environment”
require ‘fcgi_handler’
fix for random 500 errors
class MyHandler < RailsFCGIHandler
SIGNALS = {
‘TERM’ => :exit_now,
}
def exit_now_handler(signal)
dispatcher_log :info, “ignoring request to terminate immediately”
end
end
end fix for random 500 errors
original handler
RailsFCGIHandler.process!
MyHandler.process!
Also consider a cron job to periodically hit one of your non-cached
actions every so often to keep the application “fresh”.