Page 1 of 1
max_connections error
Posted: Sat Oct 22, 2005 5:16 pm
by leonardobii
Recently, I have been getting the following error
Fatal error: User 'dhf' has exceeded the 'max_connections' resource (current value: 7200)
cant figure it out, can somebody help me out?
Posted: Sun Oct 23, 2005 10:54 pm
by hanji
Whoa... That doesn't look too good.
max_connections is the value set for how may mysql connections can be made. Is this on a shared hosting environment? Current value of 7200 is alot. MySQL defaults at 150. If this is the case, you may be on a over worked box. You may also want to add addiitional error handling around your mysql_connect to not show error messages. Showing the username to a potential attacker may not be a good thing. I would wrap your mysql_connect() call with an 'if' and die().
Code: Select all
if(!$connect = mysql_connect($DBserver, $DBuser, $DBpassword)){
die("Database Connection Error");
}
If this is not a shared hosting environment, but your dedicated server.. I would check to make sure you're not a victim of a DoS.. since that is a lot of connections to allow at a given moment.
Hope this helps
hanji
Posted: Mon Oct 24, 2005 10:31 am
by foobar
hanji wrote:
Code: Select all
if(!$connect = mysql_connect($DBserver, $DBuser, $DBpassword)){
die("Database Connection Error");
}
Forget it! Don't be nice to those wankers, do it the manly way (ie: use brute force until you get what you want):
Code: Select all
while(!$connect = @mysql_connect($DBserver, $DBuser, $DBpassword)) { usleep(10000); }
That'll keep going until you get your damn connection. Yarrr!
Posted: Mon Oct 24, 2005 10:37 am
by leonardobii
thanks, i appreciate the help
Posted: Mon Oct 24, 2005 10:41 am
by hanji
foobar wrote:hanji wrote:
Code: Select all
if(!$connect = mysql_connect($DBserver, $DBuser, $DBpassword)){
die("Database Connection Error");
}
Forget it! Don't be nice to those wankers, do it the manly way (ie: use brute force until you get what you want):
Code: Select all
while(!$connect = @mysql_connect($DBserver, $DBuser, $DBpassword)) { usleep(10000); }
That'll keep going until you get your damn connection. Yarrr!
foobar... I like it!
hanji
Posted: Mon Oct 24, 2005 10:44 am
by foobar
hanji wrote:
foobar... I like it!
hanji
Ye can always rely on ye ole bucaneer. Yarrr...
