Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
It hardly seems like it would be worth the trouble of having the application manage all of the cases where things could fail.
Drupal does, however, keep a connection open for each Web server process. That is, each time a Drupal page is requested, the same connection is kept open and used repeatedly for subsequent queries within the page request (unless it dies, in which case a new connection is opened). For details, have a look at the code in db_query().
So basically, MySQL's max_connections should be set slightly higher than the number of PHP processes (MaxClients if you're using Apache). See Is db_query() closing connections? for details.
Comments
See
See http://drupal.org/node/42626
Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors
Sure, for drupal 4
Attached node includes the following applies to "Drupal 4.5.x or older, Drupal 4.6.x, Drupal 4.7.x"
Anyone have some updated information about D7 ?
It is quite clear that Drupal
It is quite clear that Drupal does not now support persistent connections. The thinking among core developers does not seem be fully explained in the issue queues.
http://drupal.org/node/49836
http://drupal.org/node/1079892
Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors
Not recommended
There are problems with using persistent connections with PDO (the DB interface Drupal 7 uses) as described over at What are the disadvantages of using persistent connection in PDO?.
It hardly seems like it would be worth the trouble of having the application manage all of the cases where things could fail.
Drupal does, however, keep a connection open for each Web server process. That is, each time a Drupal page is requested, the same connection is kept open and used repeatedly for subsequent queries within the page request (unless it dies, in which case a new connection is opened). For details, have a look at the code in db_query().
So basically, MySQL's max_connections should be set slightly higher than the number of PHP processes (MaxClients if you're using Apache). See Is db_query() closing connections? for details.