Re: FastCGI Expert Sought
Kornél Pál <[email protected]>
| Newsgroups | gmane.comp.web.fastcgi.devel |
|---|---|
| Message-ID | <[email protected]> |
Ross Richey wrote: > Several people have suggested that PERL is the problem. And indeed in a > sense it is. It's really hard to keep PERL from leaking memory, so hard > it's not worth even trying. This wouldn't be a problem if, after a > certain number of requests, we could just nicely kill the old FastCGI > process and respawn a new one. Instead we get processes which are > defunct and Lighttpd will eventually run out of live FastCGI processes > to use and then it will no longer be able to serve those requests. If you mean processes marked as <defunct> by ps that are also known as zombie processes then this has nothing to do with that process. Zomobie processes are caused by the parent process. A zombie process is basically only consuming a PID, there is no real process behind it. There are three ways to get rid of zombie processes: 1) Kill the parent process. 2) Fork a new process at the very beginning of your program an exit the original process that is now the parent that makes init the new parent of your now orphaned process that takes care about calling wait(). 3) Fix the parent by handling SIGCHLD and calling wait() in the handler. This latter is the real solution but if you don't want to touch the parent process you should do number 2. Kornél