Re: need mysql_ping when using mysql_pconnect?
| From: | Richard Lynch | Date: | Thu, 09 Aug 2007 05:06:15 +0000 |
| Subject: | Re: need mysql_ping when using mysql_pconnect? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-260491@lists.php.net to get a copy of this message | ||
On Wed, August 8, 2007 3:05 am, lists@dwsasia.com wrote:
> Quoting Richard Lynch <ceo@l-i-e.com>:
> Yes that is true. I only use mysql_ping in scripts with long idle
> times (up to one hour idle time), and then I noticed that the mysql
> connection goes down. Using mysql_ping will not just check that it is
> alive, but also try to reconnect if it was down.
>
> I'd never use mysql_ping in scripts that have short life length.
A script that sits idle for an hour or so and ties up a MySQL
connection the whole time it's just sitting there?...
Sounds like maybe a Design Issue to me...
Maybe some kind of daemon listening for incoming traffic on a port,
but even then, your MySQL connections are kinda expensive, so maybe
the idle loop should close them down and re-open them when
not/needed...
Just a suggestion.
Maybe the server has such low load it's irrelevant too. :-)
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?