Actually its quite easy to support mysqli support persistent connection in vBulletin: You only need to replace the following code in class_core.php (vB_Database_MySQLi class) :
with the following code:
After that you enable db persistent connection in your config.php
Tested! In my case, huge difference in performance. MySQL CPU reduced from 23% to 16% (since I have really busy server)
upon the end of script execution, mysqli do cleaning automatically so you don't have to worry about locked tables or whatever, just use it! (see this)
Of course this requires that you run something like php-fpm (so the connection remain open during the lifespan of PHP child process). Moreover you should have MySQL max connection set to suitable value (usually number of different connection * max number of PHP children)
Oh what I mean by different connections is the connections that differ in database, user or both.
I hope I can see this change in 4.2.3
thanks
PHP Code:
$connect = $this->functions['connect']($link, $servername, $username, $password, '', $port);
PHP Code:
if($usepconnect) $connect = $this->functions['connect']($link, 'p:' . $servername, $username, $password, '', $port);
else $connect = $this->functions['connect']($link, $servername, $username, $password, '', $port);
Tested! In my case, huge difference in performance. MySQL CPU reduced from 23% to 16% (since I have really busy server)
upon the end of script execution, mysqli do cleaning automatically so you don't have to worry about locked tables or whatever, just use it! (see this)
Of course this requires that you run something like php-fpm (so the connection remain open during the lifespan of PHP child process). Moreover you should have MySQL max connection set to suitable value (usually number of different connection * max number of PHP children)
Oh what I mean by different connections is the connections that differ in database, user or both.
I hope I can see this change in 4.2.3
thanks
Comment