Make WordPress Core

Opened 19 years ago

Closed 19 years ago

Last modified 17 years ago

#5278 closed enhancement (wontfix)

Allow persistent MySQL connections

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

Description

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
19 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
19 years ago

  • Resolution → wontfix
  • Status new → closed
Note: See TracTickets for help on using tickets.