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.... <br /> <br />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. <br /> <br />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. <br /> <br /><pre><font class="small">code:</font><hr> <br />if ($this->dbh == 0) <br />{ <br /> for($i=0; $i<5; $i++) <br /> { <br /> if ($config[persistent] == "off") <br /> { <br /> if (($this->dbh=mysql_connect($config['dbserver'],$config['dbuser'],$config['dbpass']))>0) <br /> break; <br /> } <br /> else <br /> { <br /> if (($this->dbh = mysql_pconnect($config['dbserver'],$config['dbuser'],$config['dbpass']))>0) <br /> break; <br /> } <br /> sleep(2); <br /> } <br />} <br /></pre><hr> <br /> <br /> <br />.. or maybe you could just check for that type or error and make it sleep/retry.
Edited by 3DSHROOM (05/10/02 12:36 AM)