Rapid MySQL Folder Growth Caused by Binlog Accumulation in AEM

The MySQL folder in an AEM On-Premise environment expands rapidly because of retained binary log (binlog) files. These binary log files accumulate over time, consuming significant disk space. You can resolve this issue by configuring a shorter retention period for binlog files in the MySQL settings.

Description description

Environment

  • Product: Adobe Experience Manager (AEM) JEE On-Premises, v 6.5
  • Instance: Production

Issue/Symptoms

  • The MySQL folder size increases rapidly over a short period.
  • Disk usage spikes significantly, reaching up to 75% of total capacity.
  • Multiple large binary log (binlog) files accumulate in the MySQL data directory.
  • The system fails to purge outdated binlog files, leading to excessive storage consumption.

Resolution resolution

Follow these steps to resolve the issue:

  1. Back up the MySQL database instance before making any changes.

  2. Open the MySQL configuration file (my.cnf) and locate the binlog_expire_logs_seconds parameter.

  3. Set a new retention period, such as binlog_expire_logs_seconds = 1296000 (1296000 seconds equals 15 days).

  4. Save and close the configuration file.

  5. Reload the daemon configurations and restart MySQL:

    code language-none
    sudo systemctl daemon-reload
    
    code language-none
    sudo systemctl restart mysql
    
  6. Stop and restart the MySQL service to apply the changes.

  7. Run the query SHOW VARIABLES LIKE 'binlog_expire_logs_seconds'; to confirm the updated value.

  8. Monitor disk usage to ensure older binlogs are purged automatically.

Notes:

  • Shortening the binlog retention period reduces the available backup history. Confirm that the new setting meets your recovery requirements.
  • Ensure you have the necessary permissions to edit configuration files and restart services.
recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f