473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

mysql_pconnect() Do persistent connections ever die?


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 19 '05 #1
5 2646
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 19 '05 #2
"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 19 '05 #3
"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 19 '05 #4
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 19 '05 #5
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 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Randell D. | last post by:
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...
2
by: Steve Jenkins | last post by:
Wonder if anyone can help. So, I've read: >> http://uk2.php.net/function.mysql-pconnect >> http://uk2.php.net/manual/en/features.persistent-connections.php Can one seriously see persistent...
4
by: M. Katz | last post by:
I'm relatively new to PHP/MySQL and I've heard about maintaining a persistent connection to the database. To save overhead, I'd like to maintain the connection in a session variable, but I have a...
5
by: Felix E. Klee | last post by:
I've set up a PHP web application where users can log in and open a connection to a NNTP-server. There is a *one-to-one* relationship between sessions and NNTP-connections (i.e. exactly one...
1
by: Chris Spencer | last post by:
I noticed the SimpleXMLRPCServer/ServerProxy creates a new socket for remote procedure call. I've written a simple IP based authentication scheme for the Server, and I'd like to include the port in...
2
by: David Haynes | last post by:
If I do $conn = new msqli(...); do I automatically get persistent connections? If not, how do I get them? Fall back to pconnect()? -david-
2
by: Jim Hubbard | last post by:
Is it possible to have persistent connections in ASP.Net?
0
by: manji | last post by:
I had a problem with persistent connections and had to disable in on the webserver. Now i found out that the ASP.net debugger will not function if persistent connections are disabled. I hope...
23
by: Randall Nortman | last post by:
I assume I'm not the first person to have encountered this, but I couldn't find anything in the FAQ or on the mailing lists recently. My apologies if this is already documented somewhere... My...
1
by: Paul Wagstaff | last post by:
Access 03 Runtime / Win XP Hi folks I wonder if I can tap the wizards for some general advice.. What are the risks/penalities/drawbacks for having a persistent connection to a back-end mdb? ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.