Increasing the InnoDB redo log size can reduce checkpoint churn during write-heavy workloads, smoothing I/O spikes and improving throughput when the server is constantly flushing dirty pages to keep up. Small redo logs force frequent checkpoints once the logs fill, which can turn “fast inserts” into “why is the disk screaming” under sustained load.
InnoDB writes redo records to disk so crash recovery can replay incomplete changes after an unexpected shutdown. Before MySQL 8.0.30, redo was typically stored as ib_logfile0 and ib_logfile1 in the directory defined by innodb_log_group_home_dir, defaulting to datadir when unset. From MySQL 8.0.30, redo capacity is controlled by innodb_redo_log_capacity and InnoDB maintains 32 redo log files in a #innodb_redo directory under the data directory (or under innodb_log_group_home_dir when set).
Changing redo log sizing is version-sensitive because some servers resize online while others require a clean stop and a recreate of the on-disk redo files. On MySQL, innodb_log_file_size is not dynamic and is deprecated as of 8.0.30 in favor of innodb_redo_log_capacity, which can be adjusted at runtime. On MariaDB, innodb_log_file_size becomes dynamic starting in 10.9, while older versions require a restart. The focus is changing the InnoDB log file size in MySQL or MariaDB.
Steps to change InnoDB log file size:
- Identify the server product and version.
$ sudo mysql -e "SELECT VERSION() AS version, @@version_comment AS comment;" +--------------------+----------------+ | version | comment | +--------------------+----------------+ | 10.6.16-MariaDB | MariaDB Server | +--------------------+----------------+
- Record the current redo log settings and directories.
$ sudo mysql -e "SHOW GLOBAL VARIABLES WHERE Variable_name IN ('datadir','innodb_log_group_home_dir','innodb_log_file_size','innodb_log_files_in_group','innodb_redo_log_capacity');" +---------------------------+----------------+ | Variable_name | Value | +---------------------------+----------------+ | datadir | /var/lib/mysql/| | innodb_log_group_home_dir | | | innodb_log_file_size | 50331648 | | innodb_log_files_in_group | 2 | +---------------------------+----------------+innodb_redo_log_capacity indicates MySQL 8.0.30+ redo sizing, and redo files live under #innodb_redo by default.
- Choose a target redo log size that balances write bursts against crash recovery time.
On pre-8.0.30 MySQL, total redo capacity is innodb_log_file_size * innodb_log_files_in_group, and larger values reduce checkpoint flush activity but make crash recovery slower.
- Confirm sufficient free disk space in the redo log directory.
$ df -h /var/lib/mysql Filesystem Size Used Avail Use% Mounted on /dev/vda1 40G 12G 26G 32% /
Use the innodb_log_group_home_dir value instead of /var/lib/mysql when it is set.
- Open the server configuration file for editing.
$ sudoedit /etc/mysql/mysql.conf.d/mysqld.cnf
On Ubuntu with MariaDB, the server config is commonly /etc/mysql/mariadb.conf.d/50-server.cnf.
- Add the appropriate redo log setting under [mysqld].
MySQL 8.0.30+ uses innodb_redo_log_capacity, which controls total redo capacity and determines per-file size across 32 redo files.
[mysqld] innodb_redo_log_capacity=1G
Pre-8.0.30 MySQL and most MariaDB versions use innodb_log_file_size and typically keep innodb_log_files_in_group=2.
[mysqld] innodb_log_file_size=512M innodb_log_files_in_group=2
- Apply the change online on MySQL 8.0.30 or newer when avoiding a restart is required.
$ sudo mysql -e "SET GLOBAL innodb_redo_log_capacity = 1073741824;"
innodb_redo_log_capacity is adjustable at runtime in MySQL 8.0.30+, and changes redo capacity without deleting ib_logfile files.
- Verify the runtime redo log capacity on MySQL 8.0.30 or newer.
$ sudo mysql -e "SHOW GLOBAL VARIABLES LIKE 'innodb_redo_log_capacity';" +-------------------------+------------+ | Variable_name | Value | +-------------------------+------------+ | innodb_redo_log_capacity| 1073741824 | +-------------------------+------------+
- Apply the change online on MariaDB 10.9 or newer when supported.
$ sudo mysql -e "SET GLOBAL innodb_log_file_size = 536870912;" $ sudo mysql -e "SHOW GLOBAL VARIABLES LIKE 'innodb_log_file_size';" +----------------------+-----------+ | Variable_name | Value | +----------------------+-----------+ | innodb_log_file_size | 536870912 | +----------------------+-----------+
MariaDB reports innodb_log_file_size as dynamic starting in 10.9, while older versions require a restart for resizing.
- Stop the database service before using restart-based resizing.
$ sudo systemctl stop mysql
The systemd unit may be mysql or mariadb depending on packaging.
- Confirm the database service is stopped.
$ sudo systemctl status mysql ● mysql.service - MySQL Community Server Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled) Active: inactive (dead) since Fri 2025-12-12 22:31:10 UTC; 8s ago ##### snipped ##### - Create a backup directory for existing redo log files.
$ sudo mkdir -p /var/lib/mysql/redo-log-backup
Use the directory from innodb_log_group_home_dir when set, otherwise use datadir.
- Move ib_logfile0 out of the redo log directory.
$ sudo mv /var/lib/mysql/ib_logfile0 /var/lib/mysql/redo-log-backup/
Moving or deleting redo logs without a clean shutdown risks data loss, and MySQL 8.0.30+ stores redo logs under #innodb_redo rather than ib_logfile0/ib_logfile1.
- Move ib_logfile1 out of the redo log directory when it exists.
$ sudo mv /var/lib/mysql/ib_logfile1 /var/lib/mysql/redo-log-backup/
MariaDB 10.5+ uses a single redo log file named ib_logfile0.
- Start the database service.
$ sudo systemctl start mysql
- Confirm the database service is running.
$ sudo systemctl status mysql ● mysql.service - MySQL Community Server Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled) Active: active (running) since Fri 2025-12-12 22:33:02 UTC; 6s ago ##### snipped ##### - Verify recreated redo log files match the expected sizing when ib_logfile files are used.
$ sudo ls -lh /var/lib/mysql/ib_logfile* -rw-r----- 1 mysql mysql 512M Dec 12 22:33 /var/lib/mysql/ib_logfile0 -rw-r----- 1 mysql mysql 512M Dec 12 22:33 /var/lib/mysql/ib_logfile1
MySQL 8.0.30+ maintains 32 redo files under /var/lib/mysql/#innodb_redo, with each file sized at 1/32 of innodb_redo_log_capacity.
- Verify the configured redo log value from SQL.
$ sudo mysql -e "SHOW GLOBAL VARIABLES LIKE 'innodb_log_file_size';" +----------------------+-----------+ | Variable_name | Value | +----------------------+-----------+ | innodb_log_file_size | 536870912 | +----------------------+-----------+
MySQL 8.0.30+ uses innodb_redo_log_capacity as the sizing control and deprecates innodb_log_file_size.
- Inspect the server error log when startup fails.
$ sudo tail -n 30 /var/log/mysql/error.log 2025-12-12T22:33:10.123456Z 0 [ERROR] [MY-012930] [InnoDB] The size of the log file ./ib_logfile0 is different from the specified size. 2025-12-12T22:33:10.123789Z 0 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine ##### snipped #####
A size mismatch error typically indicates old ib_logfile files remained in place after changing innodb_log_file_size.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
Comment anonymously. Login not required.
