php forum
php mysql forum
php mysql smarty
 
Topic Options
#216583 - 05/10/02 12:33 AM Too many connections
3DSHROOM_dup1 Offline
Journeyman

Registered: 04/17/02
Posts: 108
Loc: Texas
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)
_________________________
SacredShrooms.org

Top



Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks