[wp-trac] [WordPress Trac] #5278: Allow persistent MySQL connections

WordPress Trac wp-trac at lists.automattic.com
Mon Oct 29 12:28:12 GMT 2007


#5278: Allow persistent MySQL connections
-------------------------+--------------------------------------------------
 Reporter:  mastermind   |       Owner:  anonymous
     Type:  enhancement  |      Status:  new      
 Priority:  normal       |   Milestone:           
Component:  General      |     Version:           
 Severity:  normal       |    Keywords:           
-------------------------+--------------------------------------------------
 Why not optionally allow persistent MySQL connections? Sometimes they can
 really help taking weight off the MySQL server.

 in wp-config.php, add an option like:
 {{{
 define('DB_PERSISTENT', 'true');
 }}}

 in wp-includes/wp-db.php change around line 49:


 {{{
 $this->dbh = (DB_PERSISTENT == 'true')
         ? @mysql_pconnect($dbhost, $dbuser, $dbpassword)
         : @mysql_connect($dbhost, $dbuser, $dbpassword);

 }}}


 I don't know what effect this would on other servers/environments, but on
 an Apache with mod_php, it works very fine.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/5278>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list