Persistent connection

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
amir
Forum Contributor
Posts: 287
Joined: Sat Oct 07, 2006 4:28 pm

Persistent connection

Post by amir »

Hello,

My php.info displays:

Code: Select all

mysql.allow_persistent     On     On
mysql.connect_timeout     -1     -1
mysql.max_persistent  Unlimited   Unlimited
Is this setting ok to be using persistent connection? If it doesnt timeout and there is no max limit, is it safe or can it bring down the server ?

Please advise on what the settings should be. I am on my own server.

TIA!
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I think persistent connections will cause issues mainly when your script execution halts before closing the connection as I believe it leaves an open connection to the server. I think.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

I think this only applies to mysql_pconnect(). I didn't check that in the manual though.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Post Reply