473,473 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 2649
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
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.