Fastcgi nightmare

software development

#1

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

phoenix_fly


#2

I have not tried it, but I found this page that says it has a solution to the 500s on DH
http://convergentarts.com/pages/fastcgi

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


#3

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.


#4

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


#5

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

?


#6

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


#7

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

#8

Please… does anybody know what causes this problem?

  • Richard

#9

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:


#10

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

  1. Install flup(http://www.saddi.com/software/flup/)
  • copy flup folder in your /home/yourdomain/plib
  1. Test code
    ------------- Start Code -------------------------------
    #!/usr/bin/python2.4
    import sys
    sys.path.append(’/home/keitairank/plib’)
    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
WSGIServer(myapp).run()
------------- End Code -------------------------------
3. You can see this working url at
http://keitairank.com/hello.fcgi

Hope this help you

Ito