The hosing company I rent the server from told me that mysql_pconnect saves the connections, so I can use mysql_pconnect to solve the connections limits problem. I have found many posts in many forums said the msyql_pconnect use less connections.
But the mysql manual said TOTALLY IN THE OPPOSITE: "Warning
Using persistent connections can require a bit of tuning of your Apache and MySQL configurations to ensure that you do not exceed the number of connections allowed by MySQL. "
Due to the mysql_connect will auto close at the end of the script and when I go to another page, it will open a new connection, still use one connection. I don't see why msyql_pconnect saved the connections numbers.
1) So who is right? msyql_pconnect saves connections numbers or msyql_connect saves connections numbers? Could someone confirm it once for all?
I turned to believe that mysql manual is right.
But also on the msyql manual there was a comment
"Drowning under a sea of connections using mysql_connect (not pconnect) I found that php connections did NOT go away at the end of a page load. Only by setting the directive mysql.allow_persistent = Off made the connections go away. So unless I've missed something else or don't understand the meaning of 'script' the following note on this page is incorrect:
Note: The link to the server will be closed as soon as the execution of the script ends, unless it's closed earlier by explicitly calling mysql_close().
Using PHP 4.4.4 & MySQL 4.0.26 "
2) Is he right? do I have to set up the mysql.allow_persistent = Off so mysql connections could be auto closed? otherwise, the mysql connections would not be auto closed as the manual claimed?
3) How can I check to see if a connection is auto closed or not at the end of the script? So I can test it mysql that who is right and who is wrong in the above claims?
With the opposit view points of different experts that either mysql_pconnect or mysql_connect uses less connections, I need big helps to clearfy this. Thanks!