I’ve been getting an increase in traffic recently and this has led to a serious performance hit to my database server. Rackspace has come back with a reason in that using mysql_pconnect is causing Apache to max out its connections. The limit for Apache has been increased but I’m wondering if there’s a more permanent solution. The identified this code segment as the source of the problem:
function db_connect($select_db = TRUE)
{
$this->conn_id = ($this->conntype == 0) ?
@mysql_connect ($this->hostname, $this->username, $this->password):
@mysql_pconnect($this->hostname, $this->username, $this->password);
if ( ! $this->conn_id)
{
return FALSE;
}
if ($select_db == TRUE)
{
if ( ! $this->select_db())
{
return FALSE;
}
}
$this->server_info = @mysql_get_server_info();
return TRUE;
}They’re also suggesting that I change mysql_pconnect to mysql_connect but I see it there already. What’s the best approach to this?