I have a PHP-based that uses MySQLi's connection persistence feature, but I'd like to fully confirm that it's working.
I expect that the information I need is somewhere in the results of the mysqli_get_connection_stats($link)
function, or the corresponding MySQLND Statistics section available from php_info()
, but I'm not really sure which values give me the information I need.
For example, I'm seeing values for connection_reused
, does this indicate a persistent connection re-used, or a regular connection that hasn't timed out yet? pconnect_success
is at 1, but I'm uncertain as connect_success
is at 40, suggesting that there have been 39 non-persistent connections according to the PHP manual, but I'm unclear on why these may occur (as all scripts on the same host are using persistent connection methods).
One particular point of confusion is the active_connections
stat which currently returns 18446744073709551578, I'm assuming it's overflowing somehow as that's close to the limit of a 64-bit integer, and I'm fairly certain I'm not maintaining quite so many connections!
I guess I'd just like to know how exactly I should read these stats in order to determine whether MySQLi is correctly using persistent connections or not.