Fastcgi nightmare

Hello folks

I´ve seeked help already at perlmonks, webmasterworld and also at the fastcgi developers board, but just can´t manage to have a trustable environment to air up my fcgi’s for production.

Briefly, I can make them work. But something strange happens some of the times after I update new code through ftp. The script stops working and returns 500 server errors after a long wait. Then, if I wait for say 10 minutes, it starts working again.

I hear there are some configs on Apache for a 600 seconds delay re-starting of scripts after bad code. But I´m not sure this is the problem, as the script was just ok (he even started working again, as I told you).

I am beggining to think that the mod_fastcgi is mis-implementated on my server. I emailed support, but they’re just taking too long to look into my request.

If any of you has any clue or tip about this fastcgi issues on dreamhost shared accounts, please help me. I don´t know where else to go.

Thanks a lot


I have not tried it, but I found this page that says it has a solution to the 500s on DH

Use promo code My50 to save $50 on any year of these nice plans

I´ve seen it already. But it seems that is a handler for Ruby Rails, and this is not my case. I took a look at the handler’s code, and it seems it relies on the presence of Ruby Rails. Please correct me if I´m wrong.

The FastCGI processes are persistent and won’t reflect the changes to your scripts until they get restarted. You can try restarting them gently using:

killall -USR1 processNameHereOr force them to quit immediately using:

killall -9 processNameHere-Tom

-Tom Wilcoxen
convergent arts

But they don´t show at the process list. That´s the problem.
Or can i issue the command withou knowing the PID? Like:

killall -USR1 scriptname.fcgi


You should see them in the process list. Can you see them with ‘top’? Do you use a .htaccess file to transfer processing to your script? If you don’t see the processes that would seem to be part of the problem.

Also, after uploading be sure to set the permissions to ‘775’ and convert line endings if you need to (dos2unix).

You can call killall without the PID – that’s the way I use it.

-Tom Wilcoxen
convergent arts

Finally, somebody else has this problem too! DreamHost called me crazy and were unhelpful in this problem.

The problem happens to me too where I have to wait 15 minutes before trying the website again. 15 minutes AFTER I did killall -9 dispatch.fcgi. This happens sporadically.

I’ll be making a change to my code, upload the file, and do “killall -9 dispatch.fcgi”. I then try to access my rails app and it pauses for about 2 minutes before giving me a 500 server error. Refreshing will yield the same result. After waiting 15 minutes, the website will work again!

Once I’m in the state where I’m getting these 500 errors, the production.log is not modified at all whenever I make a request. There is nothing in server.log or the fastcgi log. I AM definitely running in production mode.

This costs me time and I really don’t want this to happen once my website goes live and I have to make a change to the code!

  • Richard

Please… does anybody know what causes this problem?

  • Richard

I just realized that my earlier post today was this problem. I just did killall -9 dispatch.fcgi … and then my site loaded again.

This is definitely a problem, that caused 15hours of downtime on my site, at a very bad time :stuck_out_tongue:

I’ve this problem with Python too .
After tryind various methods, I found this working for me.

  1. Install flup(
  • copy flup folder in your /home/yourdomain/plib
  1. Test code
    ------------- Start Code -------------------------------
    import sys
    def myapp(envirom, start_response):
    start_response(‘200 OK’, [(‘Content-Type’, ‘text/plain’)])
    return [‘Hello World!xx\n’]

if name == “main”:
from flup.server.fcgi_fork import WSGIServer
------------- End Code -------------------------------
3. You can see this working url at

Hope this help you