PDA

View Full Version : MySQL Database error 1226 - max_resources exceeded


induslady
Wed 27th Jun '07, 6:03pm
Hello,

My site is hosted in a shared server environment.

Off-late, my site performance has gone down very badly and I have been receiving the following MySQL errors:

1) exceeded the 'max_questions' resource (current value: 50000) Error Number : 1226

2) mysql_connect(): Too many connections

The 1st error indicates the restriction imposed by my host on the max queries allowed for a database user. The 2nd error indicates that there are too many connections to the database again exceeding the limit set for the day by the host.

But my site is fairly small site. I have no more than 50 concurrent site users logged into my forums at any point of time. Even if I consider the crawling done by yahoo slurp spider, google bot, etc. they cannot be even anywhere closer to 50,000 queries on the database. However, I have introdcued craw delay in the robots.txt file.

Whenever I ask my host, they refuse to increase the max_resources limit and ask me to upgrade to private server.

To my knowledge, I am not convinced from my site traffic that it requires to be hosted on a private server.

Please can someone advise what can be done?

DO I need to do server optimisation?

Do I need to get the vbulletin queries optimised?

Or does my database require any tweaking?

Thanks in advance.

Steve Machol
Wed 27th Jun '07, 6:12pm
Those are both server settings which only your host can increase. Frankly both of these are sign of a bad host. I suggest finding another host quickly. You will have nothing but problems with this one. Good luck!

jason|xoxide
Thu 28th Jun '07, 11:37am
But my site is fairly small site. I have no more than 50 concurrent site users logged into my forums at any point of time. Even if I consider the crawling done by yahoo slurp spider, google bot, etc. they cannot be even anywhere closer to 50,000 queries on the database. However, I have introdcued craw delay in the robots.txt file.

50000 queries per day is NOT a very high limit. For example, the front page of your forum is going to have ~10 queries (depending on the admincp options) and that's assuming that you don't have any extra hacks installed.

Try enabling debug mode on your forum. If you do that you'll see the number of queries for that page load down at the very bottom of each page.

eva2000
Thu 28th Jun '07, 11:41am
Yup as I said in your PM message and what Steve and Jason said here.

Max questions of 50000 exceeded is a very restrictive value for shared hosting environment... i suggest you move to a better web host without such restrictions

induslady
Thu 28th Jun '07, 11:46am
Hello Jason,

Thank you for your response.


Try enabling debug mode on your forum. If you do that you'll see the number of queries for that page load down at the very bottom of each page.

I am interested to ebale debugging. Can you tell me how I do it? Does it display the number of queries below each forum page?

BTW, I have no hacks installed. I have a customized front page (homepage) that has some automated queries.

When I recieve the max_questions resource exceed limit error, it is the front page (homepage) that fails to work. While the forum pages are still working.

If the db has hit the max queries limit, how is my forum pages connecting to the same db still working?

Please can you help with a response these queries. Thank you again.


Those are both server settings which only your host can increase. Frankly both of these are sign of a bad host. I suggest finding another host quickly. You will have nothing but problems with this one. Good luck!

Steve,

When you say a bad host - do you mean the hosting company?

Or is the hosting enviroment? Like I am in a shared server. Do you mean I should host in a private server?

Are there are hosting companies allowing max limit more than 50000 queries in a shared server? If yes, please let me know the name of those companies. I will give them a try.

Thank you.

induslady
Fri 29th Jun '07, 11:08am
Jason / Steve,

I am looking for your response to get some more help.

Please advise. Thanks.

jason|xoxide
Fri 29th Jun '07, 11:18am
Jason / Steve,

I am looking for your response to get some more help.

Please advise. Thanks.

There is really no way for you to receive that error on your front page but not the rest. My guess is that you actually have those sub-pages cached in your browser.

Add the following to your config.php and replace 127.0.0.1 with the IP address you are connecting from.

$ips = array('127.0.0.1');
$config['Misc']['debug'] = (in_array($_SERVER['REMOTE_ADDR'], $ips) ? true : false);If you don't mind enabling debug mode for everyone then just add:

$config['Misc']['debug'] = true;In any case, if your host refuses to budge on those ridiculously-low limits then you're going to have to find a new host. Either a shared one that is more flexible or a dedicated box where you can set your own limits (meaning none at all).