[rt-devel] Handle.pm too many clients

Feargal Reilly feargal at online.thecia.ie
Wed Mar 21 02:57:08 EST 2001


     
     On Wed, Mar 21, 2001 at 07:28:28AM +0000, Feargal Reilly wrote:
     > It's not so much apache keeping the connections I'd suspect, as mod_perl. 
     
     Sorry. I spoke imprecisely.
     
     > The problem is, each new client (read click) opens two new connections, so with 5 clients (clicks), I've 10 persistent connection processes running.
     > Five hours later, they're still running. Now all I have to do is login again, view a couple more tickets, and I max out my clients, even though I'm the only user.
     > Instead of reusing an existing connection, it's gone and done the whole construction all over again. When does it decide to open a new connection in the code?
     
     It gets one and only one per child. I don't know how apache decides to hand
     your request to a specific child...
     
     > For postgres, I am allowing 64 open connections, double the default, and way more than neccessary. 
     > For apache, I've allowed 250 MaxClients, a figure which should never, ever be reached. 
     
     If you want to have up to 250 apache processes running, then you need to tune
     your database to handle that.
     
There's no correlation between apache processes and database connections - not everything requires a db connection.

     > At most, I would expect 5-10 clients to be connecting to the web UI at a time.
     
     Then you'd be much better off all around telling apache to set a MaxClients
     of 20 or so.
     
The server is also running a public info site, which generates most of the traffic, plus a few other sites such as a mirror or two, and some stats info. These could realistically use 100 Clients at a time. But only 5-10 would ever need a postgres connection.

     > Am I to believe that mod_perl wants to open 250 postgres connections before it'll start reusing connections?
     
     I don't believe that apache children 'talk' enough to properly do connection
     pooling _between_ processes.
     
Hmm. Can you just check for me, and tell me how many postgres processes are running on your server?
I really don't want 240 idle processes sitting around saving overheads.

     > -Feargal.
     
     Jesse.  
     
     ps. you replied to me personally, but I suspect that this info would be useful
     for the general community. can I bounce this reply to rt-devel?
Of course. Silly me, meant to repl to devel, not you anyway... :)
     
     -- 
     jesse reed vincent -- root at eruditorum.org -- jesse at fsck.com 
     70EBAC90: 2A07 FC22 7DB4 42C1 9D71 0108 41A3 3FB3 70EB AC90
     
     They'll take my private key when they pry it from my cold dead fingers!




More information about the Rt-devel mailing list