clintonm9 has asked for the wisdom of the Perl Monks concerning the following question:
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!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Mod_perl, reverse proxy, long query, timeout
by locked_user sundialsvc4 (Abbot) on Apr 29, 2011 at 13:30 UTC |