(gs):Persistent MySQL connections

  • This page was last modified on December 16, 2010, at 11:04.
The (mt) Community Wiki is a collaborative project. Any (mt) Media Temple customer or employee may contribute. Not all articles and/or content have been tested for accuracy by (mt) Media Temple.

For officially moderated and tested articles, be sure to visit our KnowledgeBase.

From (mt) Community Wiki


Persistent connections are available on the (gs) Grid-Service. However, if you're using the shared SmartPool MySQL environment, you are only allocated 30 concurrent database connections. The 30 concurrent MySQL connections are allocated on a per MySQL user basis. Depending on the type and size of queries, unless you ensure that each script closes connections promptly once no longer needed, a high level of traffic or surge could breach the allocation quickly.

It's generally considered better to use PHP's mysql_connect() over mysql_pconnect() in instances such as the (gs) Grid-Service, where you do not have access to the httpd.conf and my.conf to edit the performance of these services to accommodate for the persistent connections.

Here are some third party articles on the functionality of this variable.

http://php.net/manual/en/function.mysql-pconnect.php

http://www.mysqlperformanceblog.com/2006/11/12/are-php-persistent-connections-evil/

It is possible to upgrade your concurrent MySQL connections by adding a MySQL GridContainer to your (gs) Grid-Service. The three different sizes offer 60, 100, and 150 concurrent connections respectively.

http://mediatemple.net/webhosting/gs/features/containers.php#mysql