perlquestion
talexb
<p>I'm trying to understand why a Perl CGI that's the most used page in my web application appears to sometimes 'go to sleep', tying up an Apache kid or two, when all other web pages run fine.</p>
<p>This is more or less a regular [wikipedia://CRUD] or [wikipedia://BREAD] web application running through <c>mod_cgi</c>, not <c>mod_perl</c>, using Apache 1.3, Perl 5.8.0, accessing a Postgresql database. While the database has been suspect before, it doesn't appear to be the root of the problem this time around, since I'm not seeing the fatal error about the number of connections being exceeded, and I don't see any pending SELECT statements.</p>
<p>After all that preamble, here's my question: I'd like to try to run <c>gdb</c> against the 'awake but not running and not a zombie' process to find out where it's at, but I'm not familiar about how to do such a thing. The <c>man</c> page suggests I should be able to use
<c>
gdb program 1234
</c>
to debug a running process .. in the case of a CGI, I presume that would be something like
<c>
gdb '/usr/bin/perl /path/to/cgi-bin/script.cgi' 1234
</c>
where 1234 was the PID of the sleepy child. Since the problem has solved itself for now, I can't try it today, but I'd like to know for the future, so I can found out what the heck is going on.</p>
<p>I welcome your suggestions. (No, there's nothing useful in neither the log file nor the [cpan://Log::Log4perl] debug logs .. it just goes to TT2's process method and never comes back.)</p>
<div class="pmsig"><div class="pmsig-131279">
<p>Alex / [talexb] / Toronto</p>
<p><small>"<a alt="GrokLaw, by Pamela Jones" href="http://www.groklaw.net">Groklaw</a> is the open-source mentality applied to legal research" ~ Linus Torvalds</small></p>
</div></div>