Persistent Database Connections

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[Please note that even though I cite Interbase in my example, I believe my 
question can be generalized to all databases that allow persistent 
connections]

I recently installed a trial version of Interbase on a development server 
that includes a nifty tool that allows me to monitor, among other things, 
the number of active connections to my server.  After playing with this 
feature briefly, I noticed that SEVERAL connections are opened between my 
web server and the database.  At first, I thought this was a little weird 
because I use the ibase_pconnect() function to establish communication with 
my database, and I expected to see only 1 connection.  However, after doing 
some reading, I discovered that this behavior is probably by design - the 
result of Apache spawning several child processes, each one establishing its 
own persistent connection(s) to the database.

What I am baffled by is the fact that the total nunber of connections 
between the web server and my database seems to max out at 9.  Why 9?  Not 
that I have a problem with this number.  I just want to understand how this 
limit was reached so that I might predict how the application will perform 
in a production capacity.

I have checked my Apache config (httpd.conf) file, and as far as I can tell, 
the maximum number of child processes is set to 20.  So again I ask: why 
does the number of connections max out at 9?  Shouldn't they max out at 20 
or 21 (1 parent + 20 children)?

And finally, I have noticed that the connections, once established, NEVER 
expire.  I realize that this is sort of the point with persistent 
connections, but I was curious whether persistent connections are ever 
terminated or recycled.

Any explanations/impressions would be appreciated.

Mike

FYI... My php.ini file is set to allow unlimited connections/unlimited 
persistent connections.  Also, the trial license of the database I am 
testing claims to be limited to 1 client, and the only client accessing the 
database is my web app.  Just thought I'd mention that as I don't think the 
number of connections has any direct correlation to the client license. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux