View Single Post
  #7 (permalink)  
Old 07-19-2008, 07:00 PM
RichAtVNS's Avatar
RichAtVNS RichAtVNS is offline
WebProWorld Pro
 

Join Date: Jul 2003
Location: New York, USA
Posts: 111
RichAtVNS RepRank 1
Thumbs up Re: Optimize Overhead for database

Quote:
Originally Posted by edhan View Post
I am currently running about 100 domains in one server and each domain has its own database. Currently what I am doing is accessing the phpMyAdmin once a month using root account to view all databases one by one to see if the tables are having any overhead. If there are, then I will manual choose the tables and optimize it.

Do you have a sample of the script or where can I find such script to be able to assist optimization of all domains databases from the same server at once?

Thanks!
We actually run a script every night at 4 am to compress all our databases.

Just make a batch file to run them,
1) turn off the domain for the maintence for approximately 2 minutes.
2)copy the database to a temporary copy,
3) compress the copy (through an embedded function in a module),
4) if it succeeds copy it back (so as not to corrupt the database in case it doesn't work.)
5) turn back on the domain.
6) goto the (1) for the next domain.

You don't need to do every domain every night. if you have to many.

To launch the batch use the Timer in the system scheduler. (this is available in both dos/windows and unix/linux enviornments)

Last edited by RichAtVNS : 07-19-2008 at 07:05 PM.
Reply With Quote