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.

This is more or less a regular CRUD or BREAD web application running through mod_cgi, not mod_perl, 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.

After all that preamble, here's my question: I'd like to try to run gdb 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 man page suggests I should be able to use

gdb program 1234
to debug a running process .. in the case of a CGI, I presume that would be something like
gdb '/usr/bin/perl /path/to/cgi-bin/script.cgi' 1234
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.

I welcome your suggestions. (No, there's nothing useful in neither the log file nor the Log::Log4perl debug logs .. it just goes to TT2's process method and never comes back.)

Alex / talexb / Toronto

"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds


In reply to Trying to track a sleeping CGI request with gdb by talexb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.