Home > Drupal, PHP > Fatal error: User ‘username’ has exceeded the ‘max_questions’ resource (current value: 50000) query: INSERT INTO watchdog

Fatal error: User ‘username’ has exceeded the ‘max_questions’ resource (current value: 50000) query: INSERT INTO watchdog

For instance powweb limits max questions to 50000 queries per hour per user for a database. A work around is to add the max usernames allowed per database (which is 3 I believe) edit the drupal CMS mysql login with a rotating mysql login script where it either chooses one of these usernames randomly to login to the database or a username in a set order to log in with an array. That way is increases your queries to 150,000 per hour. Unless you have well over 500 active users at once, that should get you by for an hour pretty good. But deffinatly right now, 50,000 isn’t enough if you have 100 current users. Anything more than 500 users at once, you should be on dedicated hosting by now.

So, set up the extra usernames in your webhost, the most allowed.
Then, go into your “sites” folder within the drupal directory and open up settings.php. Locate the $db_url line and put in an array that replicates how the $db_url line is set. Here is a code snippet example

$db_user_array[] = 'mysql://username1:pass23@mysql16.powweb.com/database_drupal1'; //enter 1st user name
$db_user_array[] = 'mysql://username2:pass23@mysql16.powweb.com/database_drupal1'; //enter 2nd user name
$db_user_array[] = 'mysql://username3:pass23@mysql16.powweb.com/database_drupal1'; //enter 3rd user name
$db_url = $db_user_array[ rand( 0, ( sizeof($db_user_array) -1 ) ) ];
Advertisements
Categories: Drupal, PHP
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: