NYCPHP Meetup

NYPHP.org

[nycphp-talk] mysql_pconnect

Freedman, Tom S. tfreedma at ubspw.com
Thu Aug 29 11:30:32 EDT 2002


Note that that's the wait_timeout parameter on MySQL, not PHP.  The default
is somewhere around 28800 seconds (8 hours)... You could set that to be
fairly low (around a half-hour (1800 secs), perhaps) to be sure you're
cleaning up your idle connections.

-----Original Message-----
From: Oktay Altunergil [mailto:nyphp at altunergil.com]
Sent: Thursday, August 29, 2002 10:50 AM
To: NYPHP Talk
Subject: Re: [nycphp-talk] mysql_pconnect


Apparently there's a wait_timeout parameter that sets the amount of time the
link will stay open. But in general you need not worry about these.. they
will stay open for a while and get used if some other connection request is
made during that period. 

It has nothing to do with a visitor issuing a query and walking away. The
connection -even though it's persistent- will not stay active forever.

Oktay 

On Thu, 29 Aug 2002 10:23:10 -0400
Mike Myers <myersm at optonline.net> wrote:

> 
> I think I need more real-world examples of mysql_pconnect() than my PHP
> reference provides.
> 
> In the context of a web-environment, where a user can issue a query and
then
> walk away for hours or days, how does mysql_pconnect() work?
> 
> After a connection is first established in this manner, does it ever close
> on its own if it is not explicitly told to? With multiple users accessing
> the database, what prevents an ever increasing number of persistent
> connections?
> 
> -- Mike Myers
> 
> 



More information about the talk mailing list