Im pretty much always trying to find ways for my servers to run as fast as possible while still keeping a light load. On one site I host they was using tons of mysql resources so I found this php script that optimizes all mysql dbs. So I set it to a 2 hour cron, since then the site done great. I suppose poor coding made the tables need optimizing very shortly. SO I figured I would try something like this on the hosting servers, figured it wouldnt hurt anything in my hosting enviorment which is mainly php/mysql cms and forums.
I ran it on a daily cron, Wasnt really a noticable difference because the server already runs pretty good but Im sure it helps some. If you are interested in trying it then get this file
wget nix101.com/opt.txt
rename it to opt.php then move it to a non-world-readable directory like /root because when you have it filled out it will keep your mysql root login on it. Then put a chmod of 600 or 700 to be safe.
Then add this line to crontab
0 1 * * * php -q /root/opt.php >/dev/null 2>&1
This will optimize all mysql databases on your server nightly at 1 am.
Related Articles
No user responded in this post