Reply to Persistent Database Connections

Your name:

Reply:


Posted by Michael Phillipson on 09/26/27 11:14

[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.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация