Any insight at all would be appreciated.
- Regardless of the outcome, change hosting company, keep the friend.
Really you don't give us much detail on the code that is causing this do you ?
Tiago | [reply] |
It seems the more lengthy the processing behind the code, the higher the chance of going defunct. My stuff runs in .2 seconds and defunts about 70% of the time. A "Hello, world" will defunct about 10% of the time. use CGI; also seems to add to the percentage, as well.
| [reply] [d/l] |
What errors are getting sent to the Apache error log and to STDERR when the script pukes?
Maybe you could put up some relevant code bits which you think might be causing the problem?
Without either of these, we really can't help. You'll just have to pick one: 1 2
| [reply] |
Ahum,
If you would be so kind to post the code fragment that looks like:
while(1) { }
Otherwise it will be difficult to help ..
Seriously, can you give us some more details? Access and error log from apache, code snippets or the complete script?
Johan
| [reply] [d/l] |
I had similar problems with Apache and Oracle 8i on Linux. What I experienced was that Oracle was mysteriously hanging onto open database cursors which would cause a process to chew up CPU time. Looks like it was a problem with my version of Oracle. At any rate, I had to resort to writing a script to wake up every few minutes and kill the offending process. Not an ideal solution, I know.
To ensure that this is not happening to you, I advise to to close your database cursors, to undef them, and to do a disconnect at the end of processing just to reduce the chances that your code is causing the problem.
However, the bigger issue is that your buddy really needs to get mod_perl working. If your friend is on RH7, he needs to make sure to install mod_perl version 1.2.4 or better (the one distributed with RH7 had problems).
The benefit to installing mod_perl as I understand it is that it performs a task known as "connection pooling" for your database connections. Rather than actually connecting to the database when you say $dbh->connect(), mod_perl keeps a certain number of connections alive at all times so that you don't have to waste valuable time on the connect. You won't have to modify your code after mod_perl is in place, so go on, punch your buddy in the teeth and tell him to install mod_perl.
and I like chicken. | [reply] |
I am having a similar problem. It seems to have nothing to do with anything except perl itself, and farnkly it looks like a bug to me, or at least something that failed to reach the docs.
The thing is that under certain conditions (perhaps something with while(1) ), scripts hang on ``, qx{} or open "command |". It doesn't matter which one i use, it always comes down to the same outcome: the child process finishes and goes defunct, and the calling script doesn't seem to notice that, it just keeps waiting for something...
At the moment i have no idea why and how to fix this. The thing is, of course, that i want the child's output. I can do a simple workaround throwing the output into some file and sending a usr1 signal to the parent on exit, but that giving up isn't it... | [reply] |