Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Nightly Database Optimizer Details »»
Nightly Database Optimizer
Version: 1.00, by Gamingforce Gamingforce is offline
Developer Last Online: Jan 2007 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 07-27-2004 Last Update: Never Installs: 35
 
No support by the author.

[ Feature Description ]
This is a simple, very easy to install hack that automatically optimizes your database daily! The optimizer uses MySQL's 'optimize table' function. In simple terms, you can look at the optimize command as a hard drive defragmenter. It reclaims lost space and defragments the database file.

By default, this modification runs the optimize script nightly at 3:22 AM (which statistically on my board is the least busiest time). You can run it weekly, monthly or whenever you want by changing the settings under the Scheduled Task Manager.

The script includes all the tables that get heavy daily activity. You can easily add other tables if you wish by opening up the dboptimize.php file and simply adding extra table names to the end of the list.

[ Version Fix Log ]
1.00 -> 1.01 - July 28, 2004
  • Added sleep code that adds a pause after each database process. (Thanks KirbyDE)
Enjoy!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 07-30-2004, 04:12 AM
Gamingforce's Avatar
Gamingforce Gamingforce is offline
 
Join Date: Oct 2001
Location: New York City
Posts: 128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay I did a fun stress test earlier today running the Optimize command for 20,000 times on the heavily accessed/updated USER table with 200+ concurrent users on my board and no problems at all.

TCS: Repair is built into Optimize. No need to run both.
Reply With Quote
  #23  
Old 07-31-2004, 11:19 PM
pixelpunk's Avatar
pixelpunk pixelpunk is offline
 
Join Date: Apr 2002
Location: Memphis, Tn
Posts: 56
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what would it take for this script to turn the board off between time A and time B and possibly give the admin the choice to run it on certain days?

It'd be much like eBay (among other sites) closing for maintainence.
Reply With Quote
  #24  
Old 08-01-2004, 12:47 AM
TheComputerGuy's Avatar
TheComputerGuy TheComputerGuy is offline
 
Join Date: Oct 2001
Location: TX
Posts: 580
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed...but pixelpunk has a great idea!
Reply With Quote
  #25  
Old 08-01-2004, 01:27 AM
Gamingforce's Avatar
Gamingforce Gamingforce is offline
 
Join Date: Oct 2001
Location: New York City
Posts: 128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There is no need to close the board. It's just downtime for your users. vBulletin's CRON system doesn't allow you to select more than one day a week, but I can work around that by having the script run daily, but instead run the code within it only on certain days. I'll look into that.
Reply With Quote
  #26  
Old 08-01-2004, 01:29 AM
TheComputerGuy's Avatar
TheComputerGuy TheComputerGuy is offline
 
Join Date: Oct 2001
Location: TX
Posts: 580
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Gamingforce
There is no need to close the board. It's just downtime for your users.
True, I just thought since it would be a dead time on the board anyways...it would no matter
Reply With Quote
  #27  
Old 08-01-2004, 01:30 AM
Gamingforce's Avatar
Gamingforce Gamingforce is offline
 
Join Date: Oct 2001
Location: New York City
Posts: 128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If it's a dead time, then why close it?
Reply With Quote
  #28  
Old 08-01-2004, 02:53 AM
TheComputerGuy's Avatar
TheComputerGuy TheComputerGuy is offline
 
Join Date: Oct 2001
Location: TX
Posts: 580
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Gamingforce
If it's a dead time, then why close it?
exactly. great point sir!
Reply With Quote
  #29  
Old 08-03-2004, 08:07 AM
pixelpunk's Avatar
pixelpunk pixelpunk is offline
 
Join Date: Apr 2002
Location: Memphis, Tn
Posts: 56
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Statistics can't predict exactly when someone will post during your boards 'dead time.'

There is still that risk of the database becoming corrupt because someone's inserting data into it while it's optimizing so why not kill it 100% just to be safe.

Still a kickin-rad hack though! Thanks GamingForce.
Reply With Quote
  #30  
Old 08-03-2004, 02:24 PM
Ghostsuit's Avatar
Ghostsuit Ghostsuit is offline
 
Join Date: Nov 2001
Location: Glasgow, Scotland
Posts: 199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Gamingforce
The optimization happens at off peak times and content is still accessible during the optimization process. I have a board with almost a million posts and it works fine.

Ahh cool sounds good then
Reply With Quote
  #31  
Old 08-03-2004, 09:37 PM
Gamingforce's Avatar
Gamingforce Gamingforce is offline
 
Join Date: Oct 2001
Location: New York City
Posts: 128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by pixelpunk
Statistics can't predict exactly when someone will post during your boards 'dead time.'

There is still that risk of the database becoming corrupt because someone's inserting data into it while it's optimizing so why not kill it 100% just to be safe.

Still a kickin-rad hack though! Thanks GamingForce.
I really do think it's 100% safe because MySQL locks the table from updates/inserts while it's optimizing it.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:14 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04555 seconds
  • Memory Usage 2,306KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete