Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

OT: Defunct & Killing the Server

by Anonymous Monk
on Dec 20, 2001 at 02:45 UTC ( #133305=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'll start out with an appology for the off topic post. Reap me if I'm too off topic. I know of no other place to ask.

I'm running a moderate sized Perl/CGI script that I wrote on an Apache server. About 60% of the time, when it is spawned, it will leave a "defunct" process that eats up a large chunk of CPU cycles for about a second, to the point where it is causing problems for other applications on the same box.

I'm running with strict and warnings, I have cleaned up all the warnings and am properly exitting.

Any insight would be appreciated. Thanks!

Replies are listed 'Best First'.
Re: OT: Defunct & Killing the Server
by Anonymous Monk on Dec 20, 2001 at 03:31 UTC
    I just realized that I used CGI.pm in my "Hello World" test. I just tried it manually printing the headers, no defuncts. I added use CGI;, and I got a few defuncts.

    Could it be the beloved CGI.pm causing the problems!? I'm using version 2.76.
      I had some problems earlier with CGI.pm's "offline" mode running as a child process. if it helps at all I foud that a wrapper script was running the perl code on the command line and redirecting the output to apache.
Re: OT: Defunct & Killing the Server
by hydo (Monk) on Dec 20, 2001 at 03:13 UTC
    What platform is this and are you using DBI?
    There used to be an issue with DBI and Oracle 7 but the chances of this applying to you are probably slim. So actually, could you post your platform and what modules you are using? It would narrow this down considerably =)
      Linux (I'm pretty sure its Debian) I am using DBI, but with mySQL. Other notable modules are CGI and CGI::Debug. Hosted by Apache Advanced Extranet Server.

      Even a simple "Hello world" script, when refresh is pressed quickly and repeatedly, generates defunct processes.
        Might be time to look for another hosting provider.
        A defunct process is a process that has exited but still has an entry in the kernels process table. In most unices it has no size other than the sizeof() the entry itself. There is one unix variant that does store some resident information about the process other than its table entry but I cant remember which one offhand. This should not kill the server unless there are so many of them that they fill the process table in which case all fork()s will return errors until there is space for thier new processes in the table.
        Are these processes exiting after a while or are they staying around? These processes are normal in that all processes besides init become defunct when they exit() and are cleaned from the process table by init or the kernel. Logic would then suggest that the cleaner-upper (very technical term there) isn't doing its job. =)
        So if I were you, I would look for another hosting provider.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://133305]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2023-12-11 12:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (41 votes). Check out past polls.

    Notices?