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
  #32  
Old 08-03-2004, 10:16 PM
nintendo's Avatar
nintendo nintendo is offline
 
Join Date: Dec 2001
Posts: 117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Today I wad doing an optimizing/repair from admincp. I had to do it about five or six times since it never repairs completly in one run, and that crashed the database!!! I had to go into phpMYAdmin and repair the user table to get the boards back-up. It was the first time the database had ever crashed while doing a repair/optimizing. It might be the php version. Yesterday I had a Pro upgrade me from the buggy 4.2.2 version to 4.3.3.
Reply With Quote
  #33  
Old 08-03-2004, 10:27 PM
Sadie Frost's Avatar
Sadie Frost Sadie Frost is offline
 
Join Date: Dec 2001
Location: Pittsburgh
Posts: 307
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just a quick question - I installed this and ran it, and I got no message just a white screen and my broswer window said "Done". Just making sure it wasn't supposed to give a message when it's done? (Want to make sure it's actually working.) Thanks!

PS I ran the file manually because I wanted to close the board while I did it.
Reply With Quote
  #34  
Old 08-12-2004, 04:10 PM
manguish manguish is offline
 
Join Date: Apr 2003
Location: UK
Posts: 204
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm. Nice idea, but i get this :

Warning: main(./includes/dboptimize.php): failed to open stream: No such file or directory in /home/minimoto/public_html/vb/admincp/cronadmin.php on line 56

Fatal error: main(): Failed opening required './includes/dboptimize.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/minimoto/public_html/vb/admincp/cronadmin.php on line 56

Any ideas?
Reply With Quote
  #35  
Old 08-12-2004, 04:13 PM
manguish manguish is offline
 
Join Date: Apr 2003
Location: UK
Posts: 204
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Edit : Scrap that found the mistake :

In your install.txt file you have :


5) Change Filename to: ./includes/dboptimize.php

It should be :

5) Change Filename to: ./includes/CRON/dboptimize.php

Reply With Quote
  #36  
Old 09-10-2004, 06:55 AM
venomx's Avatar
venomx venomx is offline
 
Join Date: Apr 2002
Location: Pennsylvania USA
Posts: 441
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

5) Change Filename to: ./includes/dboptimize.php

should be ./includes/cron/dboptimize.php
Reply With Quote
  #37  
Old 09-10-2004, 09:23 AM
Megareus Rex's Avatar
Megareus Rex Megareus Rex is offline
 
Join Date: Feb 2004
Location: Pennsylvania, USA
Posts: 243
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for this hack

*installs*
Reply With Quote
  #38  
Old 10-24-2004, 03:57 PM
Loki12 Loki12 is offline
 
Join Date: Jul 2004
Posts: 152
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by thegunowner149
What is the difference between this and the vbulletin repair/optize function that is built in (other than being automatic of course).

Thanks.
I would like to know the answer to this question too, please.

Zachery said there was none built in, but I think thegunowner149 referred to this:
Reply With Quote
  #39  
Old 11-03-2004, 11:26 AM
wirewolf's Avatar
wirewolf wirewolf is offline
 
Join Date: Jun 2004
Location: New York City
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Be carefull running Optimize every day. It's really not needed, but once a week or even once a month. It depends on your boards' traffic.
I see your running the query "OPTIMIZE TABLE" . From the MySQL site:
Quote:
"OPTIMIZE TABLE" should be used if you have deleted a large part of a table or if you have made many changes to a table with variable-length rows (tables that have VARCHAR, BLOB, or TEXT columns). Deleted records are maintained in a linked list and subsequent INSERT operations reuse old record positions. You can use OPTIMIZE TABLE to reclaim the unused space and to defragment the data file.

In most setups, you need not run OPTIMIZE TABLE at all. Even if you do a lot of updates to variable-length rows, it's not likely that you need to do this more than once a week or month and only on certain tables.

OPTIMIZE TABLE works as follows:
* If the table has deleted or split rows, repair the table.
* If the index pages are not sorted, sort them.
* If the statistics are not up to date (and the repair couldn't be done by sorting the index), update them.

Note that MySQL locks the table during the time OPTIMIZE TABLE is running.
Click here to read the rest from MySQL 14.5.2.5 OPTIMIZE TABLE Syntax
You may want to set the query to run once a week, or month, by adding the info in to the Scheduled Tasks manager and change the wording from "Daily" to "Weekly" or "Monthly" Database Optimization.
Also, look at your tables over a few days, and you will see the ones that consistantly need optimizing. You'll find that not all of the tables need constant optimizing.
The ones that Gamingforce has on the list of ############ TABLES TO OPTIMIZE ################ are about the most common ones, but you can add and/or delete tables on the list according to your own database usage.
You could also split up the optimizing in to two cron tasks. One for daily (most used tables), and one for weekly/monthly, etc.
John
Reply With Quote
  #40  
Old 11-07-2004, 10:58 AM
Loki12 Loki12 is offline
 
Join Date: Jul 2004
Posts: 152
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Loki12

Quote:
Originally Posted by thegunowner149
What is the difference between this and the vbulletin repair/optize function that is built in (other than being automatic of course).

Thanks.
I would like to know the answer to this question too, please.

Zachery said there was none built in, but I think thegunowner149 referred to this:
Is anyone going to answer this question? Is this hack still supported?
Reply With Quote
  #41  
Old 11-07-2004, 10:59 PM
neocorteqz's Avatar
neocorteqz neocorteqz is offline
 
Join Date: May 2002
Location: Barefoot Bay Fl
Posts: 473
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Loki12
Is anyone going to answer this question? Is this hack still supported?
no real difference as far as i can see, this just allows for you to do it automatically via vBull's cron scheduler.
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.04777 seconds
  • Memory Usage 2,310KB
  • 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
  • (5)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
  • (3)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