Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 6 years ago

#5278 closed enhancement (wontfix)

Allow persistent MySQL connections

Reported by: mastermind Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:


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.

Change History (2)

#1 @mastermind
8 years ago

Hm, I've played a bit with WP and persistent connections now, and maybe it's not such a good idea after all. :-/

Seems WP, PHP, Apache and MySQL don't play well together when it comes to persistent DB connections.

#2 @foolswisdom
8 years ago

  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.