By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,985 Members | 1,777 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,985 IT Pros & Developers. It's quick & easy.

Connection Pooling and Persistent Connections

P: n/a
Wonder if anyone can help.

So, I've read:
http://uk2.php.net/function.mysql-pconnect
http://uk2.php.net/manual/en/feature...onnections.php


Can one seriously see persistent connections as a form of db
connection pooling? Is it really similar?

Thanks for any clarification from anyone,
Cheers Steve.
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Steve Jenkins <st*************@hotmail.com> wrote:
http://uk2.php.net/function.mysql-pconnect
http://uk2.php.net/manual/en/feature...onnections.php

Can one seriously see persistent connections as a form of db
connection pooling?


No, (at least with Apache) there is no shared pool of database
connections. Every child has it's own connection for it's lifetime
Is it really similar?


It's kind of similar IMHO. Users connect to the webserver and they get
either a new child or a child that already might have a database
connection. The drwaback is that the database needs to handle atleast as
much connections as there are concurrent users on the webserver. My
guess is that with mysql you don't really need persistant connections
since setting up a new connection to the database is quite fast (never
benchmarked this my self).

--

Daniel Tryba

Jul 17 '05 #2

P: n/a
Hello,

On 01/28/2004 12:42 PM, Steve Jenkins wrote:
Wonder if anyone can help.

So, I've read:
http://uk2.php.net/function.mysql-pconnect
http://uk2.php.net/manual/en/feature...onnections.php

Can one seriously see persistent connections as a form of db
connection pooling? Is it really similar?


If you configure Apache as your Web server with the proper number of
normal and surge server processes, yes. PHP will create one database
persistent database connection per Apache process. During a surge,
Apache will fork additional processes that PHP will use to create more
database connections . After the surge, the excessive number of server
processes will be terminated by Apache itself and so the database
connections.

The only care that you should take is that if you do not have enough
memory, consider serving pages and content that is is not served by PHP
scripts that access to the database, using a different server running on
a different port or IP address.

For static content (images mostly) I strongly recommend thttpd because
it serves static files much faster then Apache and with much less memory.

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

MetaL - XML based meta-programming language
http://www.meta-language.net/
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.