Log in

View Full Version : mysql_connect Database Errors


Chalex4
06-01-2010, 09:41 AM
Ever since I upgraded to vbulletin 4, my forum constantly seems to be getting database errors along the lines of this (I've got 1000 emails just today):

Database error in vBulletin :

mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: User xxxxxx_forum already has more than 'max_user_connections' active connections
/home/xxxxxx/public_html/includes/class_core.php on line 312

MySQL Error :
Error Number :
Request Date : Tuesday, June 1st 2010 @ 11:38:05 AM
Error Date : Tuesday, June 1st 2010 @ 11:38:05 AM
Script : http://www.atkcommunity.com/threads/clientscript/build/shadowbox.js
Referrer :
IP Address : 216.104.15.130
Username :
Classname : vB_Database
MySQL Version :

The script line changes in virtually every email I get to something else (probably dependent on what the person was trying to view?). However, could this be caused by my .htaccess rewrites? All the scripts begin with "http://www.atkcommunity.com/threads/".

Website: www.atkcommunity.com

Thanks in advance.

borbole
06-01-2010, 01:23 PM
You should talk to your host about this.

Videx
06-02-2010, 06:02 PM
I think the question is: Are you really opening a lot of connections, and how many are you allowed with your hosting package. We'd need to know how many simultaneous users you usually have, and if your hosting has a hard limit. Also if you have any mods that encourages people to stay connected (eg chatbox). Darned hard to tell much of anything when the actual error is blank like that.

You may want to try disabling all your mods for a while to see if one of them is acting up.

Chalex4
06-03-2010, 09:13 AM
I've just opened a support ticket with my host, so I'll let you know what they say soon. I believe this all started when I installed the vsa chatbox and started noticing hundreds more guests just viewing the chatlogs.

A couple of days ago I changed to a different chatbox and removed the other one, but perhaps the bots are just still coming. As I said above, what's with all the scripts being at /threads? That's not actually where the scripts are as that's just an SEO thing. Is my .htaccess file to blame?

--------------- Added 1275588723 at 1275588723 ---------------

Here's the reply I got:

You're allowed 25 mysql connections at once so you need to ensure that your mysql script is closing connections, this is in place so that badly coded scripts dont run away with server resources.

Any advice?

Chalex4
06-05-2010, 01:43 AM
Sorry to double post, but do you guys have any ideas?

Videx
06-05-2010, 03:15 AM
Sorry to double post, but do you guys have any ideas?If you're still getting 1000 errors a day, turn off all your mods. Re-enable them one at a time.

borbole
06-05-2010, 09:22 AM
I've just opened a support ticket with my host, so I'll let you know what they say soon. I believe this all started when I installed the vsa chatbox and started noticing hundreds more guests just viewing the chatlogs.

A couple of days ago I changed to a different chatbox and removed the other one, but perhaps the bots are just still coming. As I said above, what's with all the scripts being at /threads? That's not actually where the scripts are as that's just an SEO thing. Is my .htaccess file to blame?

--------------- Added 1275588723 at 1275588723 ---------------

Here's the reply I got:



Any advice?

Try to un-install the vsa chatbox then and see if the errors would stop.

Marco van Herwaarden
06-07-2010, 03:29 AM
A maximum of 25 connections really is not much.

Chalex4
06-08-2010, 05:05 PM
I think that the problem's now sorted thanks. I just made sure that all evidence of the VSA shoutbox was gone. For some reason it just attracted loads of bots.

Marco I'm interested to hear why 25 isn't enough so that I can talk to my host about it. Also, if I decide to switch, I'd like to know what a good number is.

Zachery
06-08-2010, 05:07 PM
It comes down to mean you can have 25 active mysql connections total. If you had 26+ users online at the same time, or possibly higehr, your users will get those errors.

Videx
06-08-2010, 05:19 PM
No way. Going through this recently on the HG forums, I know on a good day 100 users could easily share 25 mysql connections. Conversely, if something isn't working right, a single user could fill all 25. Really, on oversold shared servers the problem is usually cpu load anyway ("4.0 per cpu is acceptable" AAAGH).

I use that chatbox (as a shoutbox) and don't get the bots. Odd that some people do.

Chalex4
06-08-2010, 05:20 PM
I see, so I could potentially have hundreds of people on the site, but if more than 26 people tried to load a page at exactly the same time, one would receive an error. This could be a problem if I ever want to properly expand.

What would you recommend usually for a larger board?

EDIT: That's interesting Videx, I guess it all depends on how often your site is being indexed already.

Zachery
06-08-2010, 05:33 PM
No way. Going through this recently on the HG forums, I know on a good day 100 users could easily share 25 mysql connections. Conversely, if something isn't working right, a single user could fill all 25. Really, on oversold shared servers the problem is usually cpu load anyway ("4.0 per cpu is acceptable" AAAGH).

I use that chatbox (as a shoutbox) and don't get the bots. Odd that some people do.
No way what? It is possible for 25 users alone to kill those 25 connections, just not likely.

It really depends on how much and what if anything they're doing.

Chalex4
06-15-2010, 11:18 AM
I seem to be getting some of these errors now as well (not as many though):

Database error in vBulletin 4.0.3:

Invalid SQL:

SELECT *
FROM vb_style
WHERE (styleid = 11 AND userselect = 1)
OR styleid = 11
ORDER BY styleid ASC
LIMIT 1;

MySQL Error : MySQL server has gone away
Error Number : 2006
Request Date : Tuesday, June 15th 2010 @ 02:10:56 AM
Error Date : Tuesday, June 15th 2010 @ 02:12:35 AM
Script : http://www.atkcommunity.com/threads/2508-EA-Week-on-Steam
Referrer :
IP Address : xx.xxx.xx.xxx
Username : Unregistered
Classname : vB_Database
MySQL Version :

ChopSuey
06-15-2010, 02:33 PM
That is your MySQL server going down.

Boofo
06-15-2010, 02:53 PM
It comes down to mean you can have 25 active mysql connections total. If you had 26+ users online at the same time, or possibly higehr, your users will get those errors.
That number is kind of mis-leading though, as most connections will run in a faction of a second and close. If you have some poorly structured queries, that can cause problems with connections not closing fast enough. But, 25 is kind of low, I agree. Hostgator is set up that way unless you go the VPS setup or higher.

Zachery
06-16-2010, 01:52 AM
That number is kind of mis-leading though, as most connections will run in a faction of a second and close. If you have some poorly structured queries, that can cause problems with connections not closing fast enough. But, 25 is kind of low, I agree. Hostgator is set up that way unless you go the VPS setup or higher.
It really depends on a large number of things, if those 25 users are poking, clicking around, possibly using one of those fancy ajax chat boxes, 25 connections can get gobbled up a whole ton faster. Downloading large attachments from the database can also cause issues.

ChopSuey
06-16-2010, 07:26 AM
I'd really get a better host. 25 is a bad limit lol.

Videx
06-16-2010, 10:47 AM
I'd really get a better host. 25 is a bad limit lol.It seems to be going around nowadays though. The ads trumpet unlimited storage and bandwidth, which is true. But not too many new website owners have any idea what a MySQL connection is, nor any idea the software they'll use may need it. But from personal experience even worse is the "acceptable" CPU load on those oversold shared servers. You'll start getting mysql errors long before you get anywhere near the 25 connection limit.

ChopSuey
06-16-2010, 10:57 AM
One of the reasons i chose a VPS hahah. Shared hosting sucks.

Chalex4
06-16-2010, 01:44 PM
Can you guys recommend another host? I am currently on ukwsd's reseller-1 (http://ukwebsolutionsdirect.co.uk/uk-reseller-hosting.php) package so I wouldn't want to downgrade.

I'd like keep cPanel, WHM and be based in the UK, but really want to improve my site's performance. It's getting a bit silly now.

Is it possible to have a VPS with cPanel etc? Also, how much RAM would I need?

ChopSuey
06-16-2010, 01:46 PM
A reseller? WOW that's low. -_-;" Lol upgrade to a VPS.

Videx
06-16-2010, 02:20 PM
One of the reasons i chose a VPS hahah. Shared hosting sucks.Actually, a VPS is still a shared server, it's just less shared. In theory.