You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 285 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - big problem Bad QA3: exceeded the 'max_questions' resource [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
desa80
Nuke Soldier
Nuke Soldier


Joined: Oct 17, 2003
Posts: 23


PostPosted: Mon Oct 04, 2004 11:13 pm Reply with quoteBack to top

I have big problem before 2 days my site began to show this error message "Bad QA3:User 'mydomaincom' has exceeded the 'max_questions' resource (current value: 90000)" and no content from my php nuke 6.5. When i go to phpmyadmin at first it doesn't allow me to do anything because it is showing the same error but i optimize the db and it works, but after some time the same thing happen ERROR. I don't know from where the hell 90 000 mysql quires will come from. Do you have any suggestion? Please help!

ps. I have sentinel 2.0/1 installed but no banned ip, i just don't know where this quires come from, and before some months i hade protector installed but i removed it because it didn't allow my FriendFinder to work, is it possible something like this to happen?

Please help!
Bad QA3:User 'mydomaincom' has exceeded the 'max_questions' resource (current value: 90000)
Find all posts by desa80View user's profileSend private message
FreeBee
Sergeant
Sergeant


Joined: Aug 26, 2004
Posts: 75


PostPosted: Tue Oct 05, 2004 12:29 am Reply with quoteBack to top

Let's say your website generates 200+ queries on each page visit.

450 page visits and you get locked out
Find all posts by FreeBeeView user's profileSend private message
desa80
Nuke Soldier
Nuke Soldier


Joined: Oct 17, 2003
Posts: 23


PostPosted: Tue Oct 05, 2004 10:24 am Reply with quoteBack to top

Quote:
Let's say your website generates 200+ queries on each page visit.

450 page visits and you get locked out
you mean thats normal, I have about 1700 visitors a day, and before this never happened to my site and the number of the visitors was the same, do you have any suggestion please![/quote]
Find all posts by desa80View user's profileSend private message
desa80
Nuke Soldier
Nuke Soldier


Joined: Oct 17, 2003
Posts: 23


PostPosted: Wed Oct 06, 2004 10:20 am Reply with quoteBack to top

I optimized my db so the site run ok for a while and I turned the debuggin mode on and this messages showed:
at the top: "SQL query: select bposition from nuke_blocks where active='1' ORDER BY bposition ASC"

at the top of left blocks: "SQL query: select bid, bkey, title, content, url, blockfile, view from nuke_blocks where bposition='l' AND active='1' ORDER BY weight ASC"

at top of right blocks: "SQL query: select bid, bkey, title, content, url, blockfile, view from nuke_blocks where bposition='r' AND active='1' ORDER BY weight ASC"

at the top of center blocks(above the friendfinder random members block):
"SQL query: SELECT COUNT(id) AS total FROM nuke_user_profile1 where photo='1' and approved='1'
SQL query: SELECT ffusername, photopath FROM nuke_user_profile1 where photo='1' and approved='1' LIMIT 643, 5
SQL query: SELECT user_id from nuke_users where username='lida'
SQL query: SELECT user_id from nuke_users where username='zdraveca'
SQL query: SELECT user_id from nuke_users where username='nikki38'
SQL query: SELECT user_id from nuke_users where username='diadora78'
SQL query: SELECT user_id from nuke_users where username='georgi_fil'"

at the bottom of center blocks:
"SQL query: select bid, bkey, title, content, url, blockfile, view from nuke_blocks where bposition='c' AND active='1' ORDER BY weight ASC"

I use PROXIMA theme is it possible the theme to be some reason?
help please!
Find all posts by desa80View user's profileSend private message
FreeBee
Sergeant
Sergeant


Joined: Aug 26, 2004
Posts: 75


PostPosted: Wed Nov 17, 2004 5:04 pm Reply with quoteBack to top

I doubt that are all queries the system runs so you probably use 2 database connections.

Check if this file works for you:
http://cvs.sourceforge.net/viewcvs.py/phpnuke65-cpg/cpg82b/html/includes/sql_layer.php?rev=1.1&view=markup

Must be uploaded to: includes/sql_layer.php
Find all posts by FreeBeeView user's profileSend private message
Datamisc
Nuke Soldier
Nuke Soldier


Joined: Nov 16, 2003
Posts: 10


PostPosted: Wed Nov 24, 2004 5:52 pm Reply with quoteBack to top

Well i had this problem with ipowerweb... activated permanent connections and still had this problem... so i found a solution.

Im not a good coder but i discovered that if i created another account that directed to the same database then that account will start with 0 queries.

With that on mind i modified the includes/sql_layer.php so that if it encounters any database acces error it would instantly changed the user accesing the database.

this is the code : (sorry but its not well depured, i know many changes wil help making it better Wink )

Code:

function sql_query($query, $id)
{

global $dbtype;
global $sql_debug;
$sql_debug = 0;
$incrementa = 0;
$i = 1;
$archivito="incrementa .php"; // NOTICE how there is a blank space after incrementa and before the dot
if($sql_debug) echo "SQL query: ".str_replace(",",", ",$query)."<BR>";
switch ($dbtype) {

    case "MySQL":
        $res=@mysql_query($query, $id);

   //************************** prueba! ****************
     if( (mysql_errno() || $res == NULL ) &&  mysql_errno() != 1054 ) /* Database error? */
     {
       echo mysql_errno();
      while($i)
      {
         // The users are keept in a directory in root called cfg
         // there are 7 diferent users... incrementa1... incrementa7
         // one of them is always renamed to cfg.php
         // we search the file missing (the one renamed to config2.php), then we rename it to the original name.
         // example : we have in the cfg directory: incrementa1.php, incrementa3.php, ... incrementa 7.php
         //           so incrementa2.php is missing... we rename config2.php to incrementa2.php.
            
         $archivito[9] = chr( $incrementa+49);
             if ( !file_exists("cfg/$archivito") )
         {
            break;
         }
         $incrementa ++ ;
         if( $incrementa == 7)
             $i=0;      
      }
         // now we will rename the next incrementa file to config2.php (the next user of the database)
         // if we are at the end of the files (incrementa7) we start from 1
      if($incrementa != 7 )
      {
         if( rename( "cfg/config2.php", "cfg/$archivito") ) {
             if($incrementa == 6 )
           {
                  $incrementa = 0;
           }
           else
           {
            $incrementa++;
           }
           $archivito[9] = chr( $incrementa + 49 );
           rename ( "cfg/$archivito", "cfg/config2.php" );
                  
           // Nos reconectamos

           require_once("db/db.php");

           require_once("includes/sql_layer.php");
           $dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);

              $res=@mysql_query($query, $id);
         }
      }
        }    

   //************************** fin the end... now the new user will have 50000 queryes available again! *********

        return $res;
    break;;

    case "mSQL":
        $res=@msql_query($query, $id);
        return $res;
    break;;

    case "postgres":
    case "postgres_local":
   $res=pg_exec($id,$query);
   $result_set = new ResultSet;
   $result_set->set_result( $res );
   $result_set->set_total_rows( sql_num_rows( $result_set ) );
   $result_set->set_fetched_rows( 0 );
        return $result_set;
    break;;

    case "ODBC":
    case "ODBC_Adabas":
        $res=@odbc_exec($id,$query);
        return $res;
    break;;

    case "Interbase":
        $res=@ibase_query($id,$query);
        return $res;
    break;;

    case "Sybase":
        $res=@sybase_query($query, $id);
        return $res;
    break;;

    default:
    break;;

    }
}



Ok now you need to modify your config.php so that it will load the user stored in cfg/config2.php

Code:

require_once("cfg/config2.php");  // include the file config2.php so that the username can be changed.

$dbhost = "localhost";
$dbpass = "username";
$dbname = "databasename";
$prefix = "nuke";
$user_prefix = "nuke";
$dbtype = "MySQL";
$sitekey = "SddddddddddddddddddddddddddddddddddddddddddddddfDS+e9";
$gfx_chk = 7;
$subscription_url = "";


Note that we deleted the "$dbuname" variable

now you will have to create a directory called "cfg" in root.
and inside that directory you will have to put the following files:

config2.php
incrementa2.php
incrementa3.php
incrementa4.php
incrementa5.php
incrementa6.php
incrementa7.php

NO incrementa1 is not missing... its config2... when the user in config2 reaches 50000queries then it will be renamed to incrementa1.php... and then incrementa2.php will be renamed to config2.php

each of the past files will contain the following code.


Code:

<?php
$dbuname = "database user";
?>


Remember to create diferent users for the same database (7) and put a diferent user in each file... keep the password the same in all users so it will be easier to change them.


It worked for me..
Stills needs lots of work... hope it works for you.
Find all posts by DatamiscView user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
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



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.155 Seconds - 412 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::