Re: shouldn't mysql_pconnect force reuse of mysql connections?

From: Date: Tue, 19 Aug 2003 20:09:34 +0000
Subject: Re: shouldn't mysql_pconnect force reuse of mysql connections?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-160072@lists.php.net to get a copy of this message
* Thus wrote Curt Zirzow (curt@zirzow.dyndns.org): > * Thus wrote anders thoresson (listor@thoresson.net): > > > > function db_connect ($user, $pwd, $db, $debug = 0) > > { > > $link = @mysql_pconnect("localhost", "$user", "$pwd"); > > if($link && mysql_select_db("$db")) > > ... > > > > I thought that making another or a third call to db_connect would reuse > > the same connection to the database, since I use mysql_pconnect() to > > connect. But listing the active processes indicates something else: > > > > > > | Id | User | Host | db | Command | Time | State | Info > > | 64494 | thore | localhost | thore | Sleep | 222 | | > > | > > | 64497 | thore | localhost | thore | Sleep | 218 | | > > | > > ... > > This is expected, this is the behavour of mysql. when php requests > a pconnection, mysql will allocate a certain amount of pooled > connections that will be used. Sorry, php is the one doing the pooling not mysql. Curt -- "I used to think I was indecisive, but now I'm not so sure."

« previous php.general (#160072) next »