Work Around: Error SQL server exceeded max questions
vBulletin: 3.0x / 3.5x / 3.6x / 3.7x / 3.8x
Quote:
- The server it self auto temp bans the mysql account in use. I am sure others may have ran into this issue. I have ran into many webhosts that because of "server loads" have a cap on max questions mySQL server can be given in a time frame. (1 hour in my case) This becomes a huge problem when doing maintenance of "Update Counters" in the AdminCP. One workaround is to create multiple mysql users in your hosting account. In config.php you randomly pick one of these users to connect to the database. This will spread the questions between users and since the limit is per user. This is not a perfect solution for if an account maxes out the script will stop, but you can usually overcome the problem. I set up 7 accounts in mySQL up on 1 database all using the same password. I ran 236,968 queries without a hiccup. :cool: Edit: includes/config.php Find: PHP Code:
PHP Code:
2) Also replace password with the correct password. |
|
Yep, no poblems.
With a few changes the concept should work with any php program that accesses mySql. |
Can this work around this error?
Code:
User x already has more than 'max_user_connections' active connections ________ BOX VAPORIZER |
It should in theory.
max_user_connections - this limits only the number of simultaneous connections made using a single account.
This little bit of code takes multiple mysql user accounts (all with the same password) and spread the questions between users at random. |
Does It Work With web hosting limit connection ?If the limit 25 we can get 100 if four user ?
Does It Speed Up the Forum and Increase the server load ? Thanks. |
There is no harm in trying. I have not ran into this problem to test for an answer.
The number of simultaneous connections to the server an account can have are limits per account. If there are multi accounts, I would think each account has a limit of 25 vs. each database with a max limit. Try it out and see if your problem goes away. Report back findings please :). |
Quote:
. |
Thanks dude im using this
|
is this work for vbulletin 4?
|
Quote:
|
first of though this will make forum loading fast but after i adding more Mysql users but it made forum loading very slow :(
|
Quote:
My Database: $config['Database']['dbtype'] = 'mysqli'; |
This is genius. I didn't want to change servers and Hostgator can be a real pain in the ass. I did this and the forum was INSTANTLY faster and the hundreds of errors in my email have stopped(for now..let it continue). Thanks a ton man!
|
Quote:
|
Some webhosts will ban you for this, find a REAL webhost.
|
Is there any other benefit from spreading the connections over multiple accounts (slight performance gain, maybe)? I just moved to a dedicated server, and am wondering if I even need this any more.
|
Nope.
|
I am going to try this, hopefully it eliminates my errors:
Quote:
|
SVT, it wont in your case, your mysql server has reached the GLOBAL limit, not your user limit.
|
Quote:
|
Quote:
|
"Too many connections" is not the same as "User x already has more than 'max_user_connections' active connections"
to many connections, indicates that the mysql server itself has 0 available slots for mysql connections. Where max_user_connections indicates that a specific mysql user has reached the maxed limit. To many connections is a semi-hard limit defined in the my.ini/my.cnf file max_user_connections can be imposed at several areas, one of which is my.cnf/my.ini, but additionaly in the mysql user table specificly. It is funny, sometimes i see single site servers setup with a max_connection limit of 100, so mysql allocates enough resources to have 100 connections. But they limit their one and only mysql user to something like 30 connections. If you only want mysql to handle 30 connections, only give it 30. Now I am ranting :p Though, 9 years working with vB, and 7 of those in support, has tought me many things. |
THANK YOU Zachery!
|
All times are GMT. The time now is 03:42 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|