Instantly Speed Up Magento Commerce
This is a great way to improve the performance of your Magento hosting account and website, some users will immediately notice over a 5x speed increase! As some of you may or may not know, Magento has visitor logging and various other logs enabled by default. Eventually these logs will grow to a massive size and cause your website and the server to slow down.
Most web hosts include something like AWStats or you can use Google Analytics for advanced visitor tracking, so the logging Magento provides isn’t needed and isn’t very useful.
Why the Magento developers don’t have this disabled by default or cleared out regularly by default is way beyond me. I wish the Magento developers would realize how big of a performance factor this is and focus on increasing performance for us Magento users rather than continue to add more features and slow down the stores.
/end rant.
Enough Already - Just tell me how to do this!
1.) Download the file cleanup.php and upload it to your main Magento folder. Please note the file you are downloading is zipped so you will need to extract the file before uploading it. You only need to upload cleanup.php.
2.) Next you will need to login to your cPanel to setup a Cron Job. To do this just click on the ‘Cron Jobs’ icon under the Advanced tab in your cPanel account.
3.) Under the ‘Add New Cron Job‘ section select ‘Once a day‘ under the Common Settings drop down. After you have done that copy the following into the Command box:
curl -s -o /dev/null http://www.yourdomain.com/cleanup.php?clean=log
Make sure to change the bolded section of the code to where you uploaded the cleanup.php file to.
After doing so, click the Add New Cron Job button, and your done!
4.) If you would like to go a step further to increase your performance, while still in the cron job section you can add a new cron job to clean your var folder out.
Under Common Settings this time you can select 1st and 15th.
Add the following code to the command line:
curl -s -o /dev/null http://www.yourdomain.com/cleanup.php?clean=var
Again making sure to change the bolded selection to where the cleanup file is located, click Add New Cron Job, and again that cron will be saved and will run every 2 weeks. This one we extended a little farther apart since it doesn’t need to be ran as often.
If you have any questions or comments feel free to let us know under our blog comments section.

This was so helpful! Thank you very much! Your instructions and information was clear and concise, and very easy to understand! Thanks!
For version 1.3.2.4 this definitely helps. It got rid of a lot of clutter. It runs much faster and speeds up importing (to a degree). Thanks!
Does the cleanup.php file get dropped into the root folder on the host (mydomain.com/cleanup.php) or into the mydomain.com/store folder (mydomain.com/store/cleanup.php)? Instructions were super easy to follow and job set up was a breeze — as long as the cleanup.php file gets put into the correct place.
Dave, you should upload the file to the folder you have Magento installed in, so if you have it installed at mydomain.com/store you can place it in that folder
.
Thank you for information
Am I suppose to be able to visit this page to clean my logs?
because I uploaded the script to my main directory where my magento install is, and well its saying it can’t be found. Magento is trying to view that page through the template and it is getting a 404 file not find message. See for yourself.
Thanks, Erik