Magento Performance Boost: Enable Log Cleaning

Magento stores a lot of logging information in the database tables prefixed with log_
e.g. log_visitor_info, log_url_info, etc. As with Magento’s session files, if not handled properly, these tables will grow out of control and hinder performance.

Magento has automated log cleaning functionality built in, but it is not enabled by default. Here’s how to turn it on.

  1. Firstly you need make sure Magento’s cron system is running.
    If you are unsure about this, see this article on setting up cron (scheduled tasks).
  2. Once cron is enabled and running, simply enable log cleaning via the admin:
    System > Configuration > Advanced > System > Log Cleaning

As per the screenshot below, I like to save 1 days logs, and perform the cleaning at 4:00am each morning.

2 Responses to “Magento Performance Boost: Enable Log Cleaning”

  1. Hi Charlie. Would not cleaning the logs for an long period hinder the checkout performance in any way?

    • Hi Jon, thanks for your question! The log cleaning process should be virtually instant when it runs so will have no impact on checkout performance. Unless you are running the process for the first time and the tables have grown massive.. In this case Iā€™d recommend manually truncating all of the log tables before enabling log cleaning. Hope that helps šŸ™‚