October 24, 2020

cm-mini

Thinking Magento

Magento - Flushing Tables

In our previous posts we've discussed the importance of the cronjob as well as eav attributes, but now down to something that could possibly be more important than anything else so far. The magical log tables in magento, which will slowly but surely slow down your site until it crawls. Unfortunately most Magento users suffer from this exact problem on a regular basis and it is an every growing black mass of data that can quickly put your database into a ludicrous size of gigabytes. So, what can you do to prevent it? At present log cleaning on Magento versions does not do what it says on the tin, so for this you will have to utilise the cronjob that you have setup already and a custom module, which will be set to clean out your log tables on a nightly basis.

If you're wondering about the importance of the log tables and how we can so quickly erase the data from them, then your in luck. These tables store information on vistor information, like url trends and a few other bits. Unfortunately on a busy site you can see why these would quickly fill up.

The custom module:

There are a few pieces of code to help you with this solution, but most are rather dirty hacks, that don't work with the cronjob setup of Magento and are not controllable from the admin. We have a solution, which is based around a solution created by devgento and can be found at the below link.

Module:

Download Clean Log Tables - (Requires cronjob to be up and running in Magento)