"max_questions" errors

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   "max_questions" errors
Donovan
CZ Active Member
 Codezwiz Site Donator
Donovan has been a member for over 20 year's 20 Year Member
usa.gif ohio.gif
Occupation: Web Developer
Gender: Male
Fav. Sports Team: St Louis Cardinals
Status: Offline
Joined: Dec 03, 2003
0.02 posts per day
Posts: 160
Points: 9,216
   
I need a no "bleep" assessment on whether this is a viable solution to my overactive forum. I get this error whenever I get around 30 on the board at one time. My host has their limit set to 50,000 and they said "change your code to be more efficient". Here is the fix for this but I need to know is this doable, and where should I make this change with PHPNuke. I wont advertise on Telli's site where I found this. It was just another Host provider.



XXXXX currently limits users to 72,000 SELECT queries, per hour, per user. Once you have used up your quota, you will begin to receive "max_questions" errors until the end of the hour, and your quota is reset. Please note, this limit only applies to SELECT queries, and not INSERT queries. There has been no official word on whether UPDATE queries are affected.

Most users will never notice this limitation, however there are some programs out there that are very unconservative with their queries. Forums (AKA: bulletin boards, message boards) such as phpbb and CMS's (Content Management Systems) such as phpnuke are typically the greatest offenders due the large number of queries and the rapid click through rate.

To compensate for this limitation, you can set up 2 additional users (for a total of 3 users), and spread out your queries among them. This will give you a total of 216K SELECT queries. To set this up, you must complete 5 steps.

1) Log in to ops and go to packages > MySQL. Add users until you have 3, making sure that each user has the exact same password.

2) Locate where the database information is stored. Often it will be in a file called config.php, base.php, include.php or common.php. You should find the name, the user name, password, and server for your database.

3) Once you have found the file, you will see the variables defined in one of two fashions.
A regular variable will look like this: $db_user = "user_name";
Defined variables will look like this: define("db_user", "user_name");

4) Add the following lines of code immediately after the line you commented out.

$db_user_array[] = ""; //enter 1st user name
$db_user_array[] = ""; //enter 2nd user name
$db_user_array[] = ""; //enter 3rd user name

5) Depending on whether your script uses regular variables, or defined variables, enter one of the following lines after everything else we just added. Make sure you change "db_user" into whatever the correct name should be (see the line that you commented out).

//regular variable
$db_user = $db_user_array[ rand( 0, ( sizeof($db_user_array) -1 ) ) ];

//defined variable
define( "db_user", $db_user_array[ rand( 0, ( sizeof($db_user_array) -1 ) ) ] );

If you end up needing to remove one of your database user names in order to allow someone else to use your database, or if Powweb changes their number of users, updating the rotation script is as simple as adding or removing users from the list (eg: $db_user_array[] = ""icon_wink.gif.



Back to top Reply with quote
#2   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,440
   
Do you have the kc gentime installed so you can see how many queries you have going on in the forums?




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#3   re: "max_questions" errors
Donovan
CZ Active Member
 Codezwiz Site Donator
Donovan has been a member for over 20 year's 20 Year Member
usa.gif ohio.gif
Occupation: Web Developer
Gender: Male
Fav. Sports Team: St Louis Cardinals
Status: Offline
Joined: Dec 03, 2003
0.02 posts per day
Posts: 160
Points: 9,216
   
No, but I will if that's what it takes to solve this issue. I made the recommended change to my config.php and added the user accounts to the database and this is what I got back


Warning: head(themes//theme.php): failed to open stream: No such file or directory in /home/i3rd-inf/public_html/header.php on line 31

Warning: head(): Failed opening 'themes//theme.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/i3rd-inf/public_html/header.php on line 31

Fatal error: Call to undefined function: themeheader() in /home/i3rd-inf/public_html/header.php on line 47


Edit// Just put on gentime. What am I looking for?



Back to top Reply with quote
#4   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,440
   
What kind of querys are you producing in the forums. I used to have a login there why don't you pm me a test account so I can see what kind of queries its producing to a registered user.




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#5   Re: re: "max_questions" errors
agent69
CZ Newbie
agent69 has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Nov 23, 2004
0.00 posts per day
Posts: 1
Points: 44
   


Originally posted by Donovan @ Thu Nov 04, 2004 2:53 pm:


Edit// Just put on gentime. What am I looking for?


You:

Gender: Male
Joined: Dec 03, 2003
Posts: 102
0.29 posts per day
Points: 2,787

Him:

Age: 33
Gender: Male
Joined: May 26, 2003
Posts: 3794
6.92 posts per day
Points: 350,358

Do the math!

Have a lot of fun...



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum