I know this topic has been discussed before, but I tried every solutions still cannot solve it.

The thing is, I run my rails app in dreamhost, with FastCGI. (rails-0.14.3 + ruby-fcgi-0.8.6 + fcgi-2.4.0)
I can start my app, but I keep hitting 500 error randomly. That is, for the same page, I will get 500 sometimes, but ok after reload.

I am having exactly the same problem. My app seems to run stable once I’m down to one FCGI process. Until then, something keeps killing off my processes. This was not a problem two weeks ago and my app hasn’t changed.

Check with our support team and ask if our process monitor has been killing your processes. If you have a lot of processes hanging around that may be the case. We recently updated our process monitor to specifically handle dispatch.fcgi processes specially so that is probably not the problem but it’s worth asking.

force to restart

dispatcher_log :info, "but we will restart"
restart_handler(signal)#exit
end

For signal TERM, I force dispatch.fcgi not to exit but restart. It looks weird but at least works for me. User will not see 500 error anymore, and will only need to wait a while to restart dispatch.fcgi if something goes wrong.