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:
-
Back up the MySQL database instance before making any changes.
-
Open the MySQL configuration file (
my.cnf) and locate thebinlog_expire_logs_secondsparameter. -
Set a new retention period, such as
binlog_expire_logs_seconds = 1296000(1296000 seconds equals 15 days). -
Save and close the configuration file.
-
Reload the daemon configurations and restart MySQL:
code language-none sudo systemctl daemon-reloadcode language-none sudo systemctl restart mysql -
Stop and restart the MySQL service to apply the changes.
-
Run the query
SHOW VARIABLES LIKE 'binlog_expire_logs_seconds';to confirm the updated value. -
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.