Page MenuHomeDevCentral

Don't allow infinite grow of MariaDB binary log
Open, HighPublic

Description

The www.dereckson.be website has returned a 500 HTTP error. For sessions management, it uses the Keruald/Pluton sessions table while log complained The table 'sessions' is full.

Initial investigation showed ~23 GB of free disk space (df -h), but ZFS reported that the dataset arcology/mysql-root was using 52.4 GB — essentially its full size — due to ~60 GB of accumulated binary logs (files like db-B-001-bin.000055).

As MariaDB/MySQL binary logs filled up db-B-001 storage, it would make sense to configure binlog expiration.

Event Timeline

dereckson triaged this task as High priority.Sun, Jul 27, 15:40
dereckson created this task.

For dbserver-mysql role, configuration is located at roles/dbserver-mysql/mysql-server/files/conf.d/server.cnf

Something like this would be needed if we're >= MariaDB 10.6.1:

[mysqld]
binlog_expire_logs_seconds = 1209600 # 14 days

We use that version:

db-B-001 mysql
root@localhost [(none)]> SELECT VERSION();
+---------------------+
| VERSION()           |
+---------------------+
| 10.11.6-MariaDB-log |
+---------------------+
1 row in set (0.000 sec)

Reference: https://mariadb.com/docs/server/ha-and-performance/standard-replication/replication-and-binary-log-system-variables

For reference, the configuration contains max_binlog_size = 1000M. This only affects the maximal size of ONE log file, but it can create as many as needed.

Current server uptime is 286 days.