Dear Monks,
I have a front end Apache server with a backend apache mod_perl server. There is a reverse proxy that points to the mod_perl server from the front end. On the front end server I have the Timeout setup to 120 (The number of seconds before receives and sends time out.).

The issue comes down to MySQL queries that take over 120 seconds. I know I could just increase this number, but I would prefer to handle this in the programming.

So this makes me think about using Fork and sending some data between the client and server, but I have heard a lot of issues with this on forking the Apache process. Also, the bigger issue I see is when I use fork behind a proxy that I have to send a certain amount of data before the proxy sees the data (Not sure why).

So here is what I am thinking below (Very rough, but I think you will get the point)?

$SIG{CHLD} = 'IGNORE'; my $child = fork(); if ( $child ) { # Parent # .... DO DB Stuff sleep 10; } elsif ( $child == 0 ) { # child for (1..100) { print " "; } ## Add in clean up stuff here maybe?? exit; }


So would something like this work if I made sure the ProxyReceiveBufferSize was reached? Also, I do not want to send spaces or line breaks b/c it makes the results look very strange.

I am hoping maybe there is an entire different way to do this!!

Please let me know, thanks!


In reply to Mod_perl, reverse proxy, long query, timeout by clintonm9

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.