View Single Post
  #38  
Old 09-26-2006, 07:08 PM
Zachariah's Avatar
Zachariah Zachariah is offline
 
Join Date: Feb 2002
Location: Canoga Park, CA
Posts: 2,125
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I was working on a rotation script.
- multi usernames 1 database
each user gets 50K in a given time frame. The script rotates what user VB uses.


- this needs some work or a new way of looking @ it.
- I am busy @ the moment

Old post I found
If you have a shared host for your website you may know what I mean. MySQL users get 50,000 Questions per hour. The account is banned then after the hour you get access again.

The hosts will allow you to create unlimited users per DB.

If I reindex the search index of my forums.
"" "" any part of my site that has a lot of data.

- 50,000 limit smashed and I get the no access "finger"

Quote:
Here is what I get:

Processing: 102279 ... Done
Processing: 102281 ... Querying first post of thread... Done
Processing: 102282 ... Done
Processing: 102283 ...

Invalid SQL:
INSERT IGNORE INTO word (title) VALUES ('annnnnnything');

MySQL Error : User 'root' has exceeded the 'max_questions' resource (current value: 50000)
Error Number : 1226

Idea: "user load balance" (this may be done somewere)
- I could use some ideas
- would make a nice "how-to" also

forums/config.php

Code:
EX: w/ vBulletin 3.5.4

//	****** DATABASE NAME ******
	//	This is the name of the database where your vBulletin will be located.
	//	This must be created by your webhost.
$config['Database']['dbname'] = 'forums';

	//	****** TABLE PREFIX ******
	//	Prefix that your vBulletin tables have in the database.
$config['Database']['tableprefix'] = '';

	//	****** MASTER DATABASE USERNAME & PASSWORD ******
	//	This is the username and password you use to access MySQL.
	//	These must be obtained through your webhost.
$config['MasterServer']['username'] = 'root';
$config['MasterServer']['password'] = 'password';

	//	****** MASTER DATABASE SERVER NAME AND PORT ******
	//	This is the hostname or IP address and port of the database server.
	//	If you are unsure of what to put here, leave the default values.
$config['MasterServer']['servername'] = 'localhost';
$config['MasterServer']['port'] = 3306;


// Database array for Random users
// ##########################################
$dblogins = array();
	//	****** MASTER DATABASE USERNAME & PASSWORD ******
	//	This is the username and password you use to access MySQL.
	//	These must be obtained through your webhost.
$dblogins['1']['user'] = 'root2';
$dblogins['1']['pass'] = 'password';

	//	****** MASTER DATABASE USERNAME & PASSWORD ******
	//	This is the username and password you use to access MySQL.
	//	These must be obtained through your webhost.
$dblogins['2']['user'] = 'root3';
$dblogins['2']['pass'] = 'password';

	//	****** MASTER DATABASE USERNAME & PASSWORD ******
	//	This is the username and password you use to access MySQL.
	//	These must be obtained through your webhost.
$dblogins['3']['user'] = 'root4';
$dblogins['3']['pass'] = 'password';


// Place this below every thing.

// ********* The following does NOT need to be edited and is only used for multiple DB users ************
srand((float) microtime() * 10000000);
$dbloginid = array_rand($dblogins);
while ($dblogins[$dbloginid]['user'] == '')
{
	$dbloginid = array_rand($dblogins);
}	
$config['MasterServer']['username'] = $dblogins[$dbloginid]['user'];
$config['MasterServer']['password'] = $dblogins[$dbloginid]['pass'];

unset($dblogins, $dbloginid);
This will work but It still needs:
- counter in session memory per user and stop using account when close to 50k.

or

- IF mysql connect gives error ER_USER_LIMIT_REACHED (Error Number : 1226) THEN skip that user and use the next one.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01058 seconds
  • Memory Usage 1,784KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete