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:

  1. Identify the server product and version.
    $ mysql --table -u root -p -e "SELECT VERSION() AS version, @@version_comment AS comment;"
    +---------+------------------------------+
    | version | comment                      |
    +---------+------------------------------+
    | 8.0.44  | MySQL Community Server - GPL |
    +---------+------------------------------+
  2. Record the current redo log settings and directories.
    $ mysql --table -u root -p -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_file_size      | 50331648        |
    | innodb_log_files_in_group | 2               |
    | innodb_log_group_home_dir | ./              |
    | innodb_redo_log_capacity  | 104857600       |
    +---------------------------+-----------------+

    innodb_redo_log_capacity indicates MySQL 8.0.30+ redo sizing, and redo files live under #innodb_redo by default.

  3. 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.

  4. Confirm sufficient free disk space in the redo log directory.
    $ df -h /var/lib/mysql
    Filesystem      Size  Used Avail Use% Mounted on
    /dev/vda1        59G   20G   36G  36% /var/lib/mysql

    Use the innodb_log_group_home_dir value instead of /var/lib/mysql when it is set.

  5. Open the server configuration file for editing.
    $ sudoedit /etc/mysql/conf.d/redo-log.cnf

    On Ubuntu with MariaDB, the server config is commonly /etc/mysql/mariadb.conf.d/50-server.cnf.

  6. 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=256M

    Pre-8.0.30 MySQL and most MariaDB versions use innodb_log_file_size and typically keep innodb_log_files_in_group=2.

  7. Apply the change online on MySQL 8.0.30 or newer when avoiding a restart is required.
    $ mysql --table -u root -p -e "SET GLOBAL innodb_redo_log_capacity = 268435456; SHOW GLOBAL VARIABLES LIKE 'innodb_redo_log_capacity';"
    +--------------------------+-----------+
    | Variable_name            | Value     |
    +--------------------------+-----------+
    | innodb_redo_log_capacity | 268435456 |
    +--------------------------+-----------+

    innodb_redo_log_capacity is adjustable at runtime in MySQL 8.0.30+, and changes redo capacity without deleting ib_logfile files.

  8. Restart the database service to persist the new value.
    $ sudo docker restart sg-mysql
    sg-mysql
  9. Verify the runtime redo log capacity after restart.
    $ mysql --table -u root -p -e "SHOW GLOBAL VARIABLES LIKE 'innodb_redo_log_capacity';"
    +--------------------------+-----------+
    | Variable_name            | Value     |
    +--------------------------+-----------+
    | innodb_redo_log_capacity | 268435456 |
    +--------------------------+-----------+
  10. For older MySQL and MariaDB releases, plan a clean stop and move any existing ib_logfile files out of the data directory before restarting.

    MySQL 8.0.30+ maintains 32 redo files under /var/lib/mysql/#innodb_redo, while older releases use ib_logfile0/ib_logfile1.