Re[2]: How to handle "Internal Server Error"
Jack <[email protected]>
| Newsgroups | gmane.comp.web.fastcgi.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello Jancha, Thanks a lot for the reply. It is very helpful. Two more questions: Re: 2) I found the 600 seconds definition in mod_fastcgi source files. I think I'll change that and rebuild mod_fastcgi. I plan to make it 0 or 1. Is there any reason I shouldn't make it so short? Re: 3) I'll try to build my own error page for 503. Is there a way to run some code to notify the administrator that this has happened? Re: 4) I'm originally from the Windows world so I don't know how to make my own segfault handler on Linux yet. I'll try to find out. Let's say I had my own segfault handler and it caught the crash, what would I do in the handler code? I suppose the process is already in an faulty state when that happens, and keeping it running would not be ideal. So I should quit it and let Apache reload the process? -- Best regards, Jack Wednesday, July 27, 2005, 2:10:59 PM, you wrote: j> Hi. j> 1) "Internal Server Error" - you get such error displayed if the underlying j> program crashes for whatever reason. j> 2) Typically, if there are more than 3 crashes in 30secs, FastCGI puts a j> 600second delay before launching a new process. Theoretically, you can patch j> the fastcgi apache module. No other workaround for this. j> 3) You can make a custom page for 503 error that's shown instead of the ugly j> "Internal Server Error" page. j> 4) I strongly suggest fixing the underlying program. Perhaps, you can make up j> custom signal handlers for your program. E.g. make your own segfault handler. j> Also, you'll get 503 error if the underlying program does not return valid j> headers. j> hope this helps a bit. j> On Wednesday 27 July 2005 14:53, Jack wrote: >> Hello all, >> >> I'm using Apache2 and mod_fastcgi. I have a fcgi app that >> runs well most of the time. Sometimes an error occurs in the >> fcgi code and Apache renders a page that says "Internal Server >> Error". At the bottom, it displays the installed modules such >> as fcgi, etc. In some cases, it's because the fcgi module crashed >> and failed to output the page. Apache will restart the fcgi process >> upon another request. However, in some other cases, another request >> doesn't fix it. It seems that the process was still running, although >> I didn't check. That's my guess because I had to restart Apache to >> restore it. Apache and mod_fastcgi worked fine with other fcgi modules >> when this happened so the only reason is that cgi process. >> >> So my question is, how to handle the two scenarios of "Internal >> Service Error"? >> >> In the first scenario, when it happens it's ugly but the next request >> will be ok because a new fcgi process will be started. I'd like >> to know if there is a way to intercept that "internal server error" >> page and replace it with my own page which looks better? >> >> And in the second scenario, how to detect it when it happens, and what is >> the best approach to restore the service? Restart Apache will affect >> all clients, including those not using this fcgi module. Or, find >> all processes of the fcgi app and kill them all and let Apache restart >> them on new requests? Or, is there a way to find out which particular >> process has a problem and only kill that one? >> >> I know the best way is to fix the bug... :) ___________________________________ fastcgi-developers mailing list http://fastcgi.com/fastcgi-developers/