Still getting "random" 500 errors in rails

Still getting "random" 500 errors in rails

Posted by: Nerdmaster
Posted on: 2005-12-30 14:09:00

I posted about this months ago (august or so) and got an attempt at a fix, but that didn't seem to do much. The problem is that my rails app will work perfectly most of the time, then intermittently get 500 errors just out of the blue. 99% of the time, hitting refresh on the 500 error will bring up the page you were trying to get in the first place.

The issue is not specific to dreamhost, but I'm curious if they're working on a solution. Here's some info I found from textdrive, and their proposed solution:

In reply to:


They are aware of the issue. We're going to need to run it under cgi, until they set up some more
apache instances and spread the FastCGI sites across them.

Apache is compiled with an FD_SETSIZE of 4048 (which means it can have
4048 file descriptors going), but FastCGI just won't stop thinking it
has the default of 1028.

So that means that ones access_log + error_log + php-fastcgi +
RoR-fastcgi adds up to 1028, then FastCGI dynamic apps will start
throwing a 500 error. And the solution is just to setup half-a-dozen
Apache installs with mod_fastcgi and spread the sites across them.

What they are doing over the holiday is building support for multiple
apache instances in our "control
panel", so it will be trivial to spread people across them.



If I'm reading this right, it sounds like anybody with a rails app could be randomly affected, and as more people use fastcgi on a given server, it becomes more and more likely they'll hit this problem.

Is DreamHost aware of this issue? Is it being addressed? When my app goes live (someday), I think it'll look pretty unprofessional to have every 10th or 20th page request pop up an error...

Re: Still getting "random" 500 errors in rails

Posted by: psross
Posted on: 2005-12-30 16:35:00

I'm seeing the same issue as you with a Rails (v1.0) site I am developing at the moment.

I haven't contacted support about this, so I don't know if they are working on it. It may be worth you sending them what you've found from Textdrive.

Re: Still getting "random" 500 errors in rails

Posted by: maxxxpower
Posted on: 2006-01-11 04:58:00

Yes, I too hope this problem is being looked at.. It's very annoying when your site fails randomly and you can't do anything about it, assuming this really is the cause of the problem.

Other than this little (big?) problem, hosting Rails apps on DH works like a charm..

Re: Still getting "random" 500 errors in rails

Posted by: mattypython
Posted on: 2006-01-12 15:50:00

I'm having this same issue. This may be a dealbreaker if it can't be fixed.

Re: Still getting "random" 500 errors in rails

Posted by: mattypython
Posted on: 2006-01-16 14:45:00

One way to help this is to case your vote for: Support using the lighttpd.net webserver instead of Apache.

Re: Still getting "random" 500 errors in rails

Posted by: herods
Posted on: 2006-01-20 22:13:00

I have found and followed these instructions here:

http://convergentarts.com/pages/fastcgi

he's a dreamhost/rails guy, and his post seems to say it works.

I've tried it a short time ago, I haven't seen an error yet, but its only been 10 minutes :)


Re: Still getting "random" 500 errors in rails

Posted by: herods
Posted on: 2006-01-21 04:17:00

This didn't work.

i left it a few hours and then started random clicking and within a few minutes i got

'Unable to start Rails application'

Log message implies the process was given a message to explictly exit....

Re: Still getting "random" 500 errors in rails

Posted by: herods
Posted on: 2006-01-24 01:53:00

I stand corrected, my original post was right, since updating my fcgi_hander.rb my fastcgi stuff has been pretty stable.

if anyone cares :)

Re: Still getting "random" 500 errors in rails

Posted by: mattypython
Posted on: 2006-01-24 22:08:00

I was still getting random 500's until I added the code explained at http://work.alexyoung.org/archives/102/dreamhost-and-rails-500-errors

It's been a few days now and I haven't seen any errors yet!