Re: Disconnect database connection after idle timeout

Perrin Harkins <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <CAC0_be3BHo_p0UmSpaD-2fBy8qEFGm_za9N1vPcfDvu9Z6XiQQ@mail.gmail.com>
On Thu, Nov 13, 2014 at 5:38 PM, Xinhuan Zheng <[email protected]>
wrote:

> We have load balancer cache that can cache images and JavaScripts. This
> functions seems a bit duplicate.


It's not about caching. Here's a quote from that link I sent earlier:

"Another drawback of this approach is that when serving output to a client
with a slow connection, the huge mod_perl-enabled server process (with all
of its system resources) will be tied up until the response is completely
written to the client. While it might take a few milliseconds for your
script to complete the request, there is a chance it will be still busy for
some number of seconds or even minutes if the request is from a slow
connection client."

You might think everyone has fast connections now so this won't matter, but
it does. It's especially bad if you have keep-alive on for the apache
server running mod_perl, since that means your large mod_perl processes sit
around for some extra time doing nothing, while holding onto their database
connections. Install a front-end proxy, turn off keep-alive  on your
mod_perl and reduce your max idle servers, and watch what happens.

- Perrin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.