Tag Archives: Logs

Cleaning Magento Store’s Database logs for faster performance

23 Aug

As we all know magento is a highly scalable eCommerce system but its database is not as efficient as it should be.It contains log tables and cleaning logs at regular interval will reduce latency of query execution which in turns helps in improving the performance of a system. Magento Store performance depends on various parameters but today we will talk about how to clean the log tables.


**Click Here to View Larger Image

I strongly recommends you to backup your database before doing anything (as it is always safe to have a backup). There are various techniques to take a back up your database.

  • Free extensions available to on maze store to take the backup.
  • You can use Magento’s built in profilers to export entire database.
  • Use phpmyadmin to take a backup.

Once you are done with the backup of database. you can use these two different options to clean up your logs:

  • Clean your logs via Magento Admin Panel “Log Cleaning”.
  • Clean up your database tables directly via phpmyadmin or through commandline.

Below are the tables used by Magento to manage logs:-


How to clean logs via Magento Admin:-

  1. Log on to your Magento Admin Panel.
  2. Go to System => Configuration
  3. On the left side under Advanced click on System (Advanced = > System)
  4. Under system you will see “Log Cleaning” option
  5. Fill the desired “Log Cleaning” option values and click Save.

How to clean the logs through Command line or through phpmyadmin:-

  1. Open the database you are using for your store.
  2. Open the tables as stated above and truncate them.

Note:– Truncate means you are only deleting the values from the tables. Structure remains same. Never drop any table.

You are all done. You can also write a script to truncate the values of this tables on regular interval by putting it in cron. I will explain that in my next post.

Happy Reading and leave you valuable feedback.