NEWS:

Uncategorized 29 Jul 2005 01:35 pm

FastCGI tunning in production

If you’ve recently set up a rails app, you’re probably seeing a build-up of FastCGI processes. (If you’re not sure, run ‘top’ from the shell to view them.) Here at DreamHost you should see from about 1 to maybe 5 or so for a well-behaved app.

I’ve seen that on the mail list from DHH that the key to eliminating the rogue processes is to eliminate bugs from your code (see the last line of the reference above). But it took me going through the experience to really believe it.

So scour your production log for any possible errors or exceptions. I’ve had issues even with little things – for example, my 500.html page had a stylesheet with a relative link, something like “stylesheets/text.css”, and when a 500 error occurred from a url other than a top level, e.g. “admin/registrations” that stylesheet couldn’t be located. Changing the link to something like “/stylesheets/text.css” fixed it. I was getting a mysterious rails ‘routing’ error referencing the stylesheet. Any error seems to cause a fastcgi process to go south, but not go away.

Once I got rid of all the little (and big) errors the processes really settled down.

Comments are closed.