Quote:
Originally Posted by mihai11
So, if I call in a for loop the function query_write 1000 times then it will use the same connection, right ?
How can I be sure about this ? Is there a tool on mysql side to check how many connection were created ? (like a log file for connections)
|
You can be sure because the code only calls connect ONCE and it specifies the link variable for queries.
Quote:
Originally Posted by mihai11
One more thing: what about persistent connections ? I assume that you are talking about this:
Code:
// ****** MASTER DATABASE PERSISTENT CONNECTIONS ******
// This option allows you to turn persistent connections to MySQL on or off.
// The difference in performance is negligible for all but the largest boards.
// If you are unsure what this should be, leave it off. (0 = off; 1 = on)
$config['MasterServer']['usepconnect'] = 0;
What if I enable persistent connections ? What is changing in this case ?
|
Persistent connections are links that do not close when the execution of your script ends. When a persistent connection is requested, PHP checks if there's already an identical persistent connection (that remained open from earlier) - and if it exists, it uses it. Also, as the config file says, it will not boost performance except on the largest boards.