persistent mysql connection on a LAMP-System

From: Date: Thu, 19 Jul 2001 19:32:19 +0000
Subject: persistent mysql connection on a LAMP-System
Groups: php.dev 
Request: Send a blank email to php-dev+get-60324@lists.php.net to get a copy of this message
I was informed from a local provider about the following issue concerning pconnects with php: "A pconnect has a running time of 8 hours. A close function will be ignored. Apache has a threading concept, which doesn't cancel the thread. You can configure it but the thread will live till the last connection is closed. ( 8 hours after a pconnect ). Every new URL rquest will lead to a new thread with a new database connection with a live evalution of 8 hours. To say it simple: "if 10 user clicks on 5 sites with php scripts -> 50 pconnects will stay active." To be honest: I don't have a clue how a pconnect is executed on a LAMP-System. All I know is that I can limit the counts of pconnects within the php.ini. The Question I now have is if it's true that scripts should contain a mysql_connect instead of a pconnect or can I avoid this overhead ? ( Every book recommends to use pconnect especially for high frequented sites. ) -- Best Regards, Mark

« previous php.dev (#60324) next »