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

mysql_pconnect() Do persistent connections ever die?

P: n/a

Folks,
I currently connect to my db with PHP code that uses non-persistent
connections. I've read that persistent connections can help performance
since a connection to the db will use an existing unused connection.

If my system was to go through a busy period whereby I seen an extra 50% or
more activity for ten minutes or so, would the extra connections stay alive
for ever or is there a time limit of inactivity?

Would the unused connections just sleep if they don't die? Is there any
negative effect of having these connections waiting around?

Thanks - all help via the ng would be much appreciated...

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
It all depends on the database you are connecting to and its configuration.
Many databases will kill inactive threads after a defined unit of time. You
can also configure the max number of connections on many databases as well.

The negative effect of unused connections is wasted resources (memory).
There is a threshold where too many connections can cause problems. It all
depends on your database, OS, and hardware.

Tuning your database and good database design can go a long way in enhancing
performance of your PHP application.

/dkm

"Randell D." <yo**************************@yahoo.com> wrote in message
news:qakhb.54953$9l5.45409@pd7tw2no...

Folks,
I currently connect to my db with PHP code that uses non-persistent
connections. I've read that persistent connections can help performance
since a connection to the db will use an existing unused connection.

If my system was to go through a busy period whereby I seen an extra 50% or more activity for ten minutes or so, would the extra connections stay alive for ever or is there a time limit of inactivity?

Would the unused connections just sleep if they don't die? Is there any
negative effect of having these connections waiting around?

Thanks - all help via the ng would be much appreciated...

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

Jul 17 '05 #2

P: n/a
"Randell D." <yo**************************@yahoo.com> wrote in
news:qakhb.54953$9l5.45409@pd7tw2no:
I currently connect to my db with PHP code that uses non-persistent
connections. I've read that persistent connections can help
performance since a connection to the db will use an existing unused
connection.


Can I point you to the PHP manual page on Persistent Connections?

http://ca3.php.net/manual/en/feature...onnections.php

This is a pretty good article covering the ups and downs of persistent
connections, and things to look out for. They've written it all out for me
so no need to say it here :)

--
Richard

Jul 17 '05 #3

P: n/a
On Fri, 10 Oct 2003 03:06:00 GMT, Richard Podsada
<js****@superduperspamdiedietelusplanet.net> wrote:
"Randell D." <yo**************************@yahoo.com> wrote in
news:qakhb.54953$9l5.45409@pd7tw2no:
I currently connect to my db with PHP code that uses non-persistent
connections. I've read that persistent connections can help
performance since a connection to the db will use an existing unused
connection.


Can I point you to the PHP manual page on Persistent Connections?

http://ca3.php.net/manual/en/feature...onnections.php

This is a pretty good article covering the ups and downs of persistent
connections, and things to look out for. They've written it all out for me
so no need to say it here :)


Unfortunately it says nothing about timeouts; dropping connections that have
been unused for a configurable amount of time would seem to be a useful
optimisation for PHP persistent connections, but there doesn't appear be a
PHP-side facility for this.

--
Andy Hassall (an**@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.