04.07.2014, 21:18
Quote:
Yesterday I upgraded from R17 to R39-2 and I have a few questions about this new update.
1) I've decided to go with the rewritten multi-thread system, but how does the pool_size option work exactly? I understand that it regulates the amount of threads. Are there any consequences if you set this to a high number? Are pools and connection handles the same thing? [...] |
The multi-thread system holds a pool of several direct connections to the MySQL server. Usually, there are only two direct connections: the threaded one (mysql_tquery) and the unthreaded one (mysql_query). However, there is also mysql_pquery, which concurrently sends queries over several direct connections, which are in the pool mentioned earlier. You can adjust that number of connections via the pool_size parameter in mysql_connect.
The MySQL server limits the number of direct connections (I think 10 by default), so settings the pool size to a high number is very bad and will possibly prevent other programs from accessing the MySQL server.
Why? Just use mysql_errno or the automatic reconnect feature (which is enabled by default anyway).