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.
