On our old server our users often got the MySQL "Too many connections" error. Since we have moved to our new one this has virtually disappeared, but....
We usually have 100+ users at peak times with 318,273 total posts in the main database and 269,158 total in a read only archive database. I would really love to merge these again, but I don't want these errors. I have checked mysql and php config files and they both have persistant connections set at unlimited with apache at 200.
I think you should add a little better error handling for the mysql connection in mysql.inc.php. Maybe you can work with this code.
code:
if ($this->dbh == 0)
{
for($i=0; $i<5; $i++)
{
if ($config[persistent] == "off")
{
if (($this->dbh=mysql_connect($config['dbserver'],$config['dbuser'],$config['dbpass']))>0)
break;
}
else
{
if (($this->dbh = mysql_pconnect($config['dbserver'],$config['dbuser'],$config['dbpass']))>0)
break;
}
sleep(2);
}
}
.. or maybe you could just check for that type or error and make it sleep/retry.