Good MariaDB redo log tuning balances three outcomes that pull in different directions: predictable commit latency, enough log capacity for write bursts, and a durability contract the business actually understands. A larger redo log can reduce checkpoint pressure, but it does not make commits durable. A relaxed flush policy can improve throughput, but it can acknowledge transactions that disappear after a host failure. Fast storage can reduce both costs, yet only if every layer honors flush requests.
Redo advice also ages badly. MariaDB 10.5 and newer normally use one redo file named ib_logfile0; Community Server made innodb_log_file_size dynamically resizable in 10.9; MariaDB 11.0 deprecated the broad innodb_flush_method switch in favor of more explicit buffering and write-through controls. Procedures written for older MySQL or MariaDB releases can therefore be ineffective or dangerous on a current server.
This guide explains the write-ahead log, separates log capacity from commit durability, measures redo generation and checkpoint pressure, sizes and resizes safely, coordinates the binary log, validates the storage stack, and provides production troubleshooting and rollback procedures. Always begin with SELECT VERSION() and the documentation for the exact installed build.
What the InnoDB redo log protects
InnoDB modifies database pages in memory before those pages necessarily reach their tablespace files. Before a dirty page can be written, the log record describing its change must be made durable. This write-ahead logging rule lets crash recovery replay committed changes that were not yet present in data files and roll the engine forward to a consistent state.
The major components are:
- Redo log buffer: memory holding generated redo before it is written.
- Redo log file: persistent circular storage, normally
ib_logfile0on MariaDB 10.5+. - Dirty pages: modified buffer-pool pages not yet written to their tablespaces.
- Checkpoint: a log position before which required page changes are safely represented in data files.
- Log sequence number (LSN): a monotonically advancing position in the redo stream.
The redo log is not a logical history for point-in-time recovery. It is an internal crash-recovery structure that InnoDB reuses circularly. The binary log, backups, and retained binlog files serve different recovery purposes.
Redo also does not replace the doublewrite mechanism. Redo restores logical page changes after a crash; the doublewrite buffer helps recover from torn or partial page writes. Do not disable safety mechanisms because the redo log exists.
Separate capacity, flushing, and recovery
Three questions are often mixed together.
How much redo can the circular log hold?
innodb_log_file_size controls the size of each redo file. MariaDB 10.5+ normally has one file; older releases could use multiple files through innodb_log_files_in_group. That latter variable was deprecated in 10.5.2 and removed in 10.6.0.
More capacity lets InnoDB retain a longer distance between the current LSN and checkpoint. This can absorb bursts and reduce aggressive checkpoint flushing. Very small logs can force dirty pages out earlier than the workload or storage would otherwise require.
When is a commit acknowledged as durable?
innodb_flush_log_at_trx_commit controls when InnoDB writes and synchronizes redo relative to commit. Its common values are:
| Value | Commit behavior | Main risk |
|---|---|---|
1 |
Write and flush redo at each transaction commit | Highest sync cost; strongest standard durability |
2 |
Write at commit, flush periodically, normally about once per second | OS or host failure can lose recent committed transactions |
0 |
Write and flush periodically rather than at each commit | Process crash as well as host failure can lose recent transactions |
The “one second” wording is an approximation, not a maximum loss guarantee. Scheduling delays, load, and operating-system behavior can extend the interval. A database process crash, operating-system crash, power loss, and storage-controller failure are different events.
How long will crash recovery take?
Recovery time depends on the redo distance that must be scanned and applied, storage performance, page distribution, server version, and workload at failure. The configured log size is only an upper boundary; a 32 GiB log does not mean every restart replays 32 GiB.
Larger logs can permit more uncheckpointed work and therefore increase worst-case recovery exposure. Modern MariaDB recovery improvements make old blanket sizing limits unreliable, so test recovery against the actual service recovery-time objective.
Audit the running server before tuning
Collect version, topology, file settings, and durability controls:
SELECT VERSION(), @@version_comment;
SHOW GLOBAL VARIABLES WHERE Variable_name IN (
'datadir',
'innodb_log_group_home_dir',
'innodb_log_file_size',
'innodb_log_buffer_size',
'innodb_flush_log_at_trx_commit',
'innodb_flush_method',
'sync_binlog',
'log_bin',
'binlog_format'
);
On MariaDB 11.0+, also inspect the explicit I/O controls:
SHOW GLOBAL VARIABLES WHERE Variable_name IN (
'innodb_log_file_buffering',
'innodb_data_file_buffering',
'innodb_log_file_write_through',
'innodb_data_file_write_through'
);
Do not assume a variable appearing in documentation exists on the server. Build automation should feature-detect variables and fail with a clear compatibility message.
Find the active redo path. If innodb_log_group_home_dir is empty, redo resides under datadir:
mariadb --batch --skip-column-names -e "
SELECT @@GLOBAL.datadir, @@GLOBAL.innodb_log_group_home_dir;
"
Inspect files without modifying them:
find /var/lib/mysql -maxdepth 1 -type f -name 'ib_logfile*' -ls
findmnt -T /var/lib/mysql
df -hT /var/lib/mysql
Replace the path with the verified location. Never infer active redo size from a configuration fragment alone; included files and runtime changes may override it.
Read checkpoint and redo status correctly
MariaDB 10.5+ exposes useful checkpoint status variables:
SHOW GLOBAL STATUS WHERE Variable_name IN (
'Innodb_checkpoint_age',
'Innodb_checkpoint_max_age',
'Innodb_lsn_current',
'Innodb_lsn_flushed',
'Innodb_lsn_last_checkpoint',
'Innodb_os_log_written',
'Innodb_log_waits',
'Innodb_log_write_requests',
'Innodb_log_writes',
'Innodb_data_fsyncs',
'Uptime'
);
Availability varies by release. Innodb_checkpoint_age is poorly named: it is an amount of redo in bytes, not elapsed time. Compare it with Innodb_checkpoint_max_age to understand how much of the allowed checkpoint window is occupied.
SELECT VARIABLE_NAME, VARIABLE_VALUE
FROM information_schema.GLOBAL_STATUS
WHERE VARIABLE_NAME LIKE 'INNODB_CHECKPOINT%';
SHOW ENGINE INNODB STATUS supplies a point-in-time LOG section:
SHOW ENGINE INNODB STATUSG
Look for the log sequence number, flushed position, last checkpoint, pending log flushes, and pending checkpoint writes. Save snapshots with timestamps rather than reading one output in isolation.
Innodb_log_waits counts occasions when the log buffer was too small and a transaction had to wait for it to be flushed. A growing rate can indicate log-buffer pressure during large or concurrent transactions. It does not by itself mean the on-disk redo file is too small.
Measure redo generation over a representative interval
Sizing from database size or buffer-pool size alone ignores workload. Measure how quickly the application generates redo during normal and peak periods.
Capture two LSN or byte-counter samples without resetting global status:
mariadb --batch --skip-column-names -e "
SELECT NOW(6), VARIABLE_NAME, VARIABLE_VALUE
FROM information_schema.GLOBAL_STATUS
WHERE VARIABLE_NAME IN
('INNODB_LSN_CURRENT','INNODB_OS_LOG_WRITTEN',
'INNODB_CHECKPOINT_AGE','INNODB_CHECKPOINT_MAX_AGE',
'INNODB_LOG_WAITS');
" > /tmp/redo-before.tsv
sleep 300
mariadb --batch --skip-column-names -e "
SELECT NOW(6), VARIABLE_NAME, VARIABLE_VALUE
FROM information_schema.GLOBAL_STATUS
WHERE VARIABLE_NAME IN
('INNODB_LSN_CURRENT','INNODB_OS_LOG_WRITTEN',
'INNODB_CHECKPOINT_AGE','INNODB_CHECKPOINT_MAX_AGE',
'INNODB_LOG_WAITS');
" > /tmp/redo-after.tsv
For a 300-second interval:
redo_bytes_per_second = delta(Innodb_lsn_current) / 300
Use the actual elapsed timestamps, not the intended sleep duration, in production monitoring. Collect distributions across transaction peaks, imports, purge activity, DDL, backups, and batch windows. An average over an idle day can hide the five-minute burst that causes checkpoint storms.
A useful operational measure is the time represented by available checkpoint capacity:
checkpoint_window_seconds
= Innodb_checkpoint_max_age / peak_redo_bytes_per_second
This is an approximation, not a guarantee. It helps compare configurations and workloads but does not model page flushing, dirty-page distribution, or recovery speed.
Diagnose a redo log that is too small
Symptoms of checkpoint pressure can include:
- Checkpoint age repeatedly approaches maximum age.
- Dirty-page flushing becomes bursty or aggressive.
- Write latency rises during sustained imports or update waves.
- Storage utilization remains high even though foreground transactions are modest.
- Throughput oscillates as InnoDB alternates between accepting writes and forcing progress.
Correlate MariaDB metrics with the host:
iostat -xz 1 10
vmstat 1 10
pidstat -d -p "$(pidof mariadbd)" 1 10
Tool availability differs by distribution. Observe device latency, queue depth, utilization, CPU I/O wait, process writes, free memory, and swap. A saturated device may need workload scheduling, faster storage, or a better flushing configuration; a larger redo log can defer pressure but cannot create I/O capacity.
Also inspect dirty-page behavior:
SHOW GLOBAL STATUS WHERE Variable_name IN (
'Innodb_buffer_pool_pages_dirty',
'Innodb_buffer_pool_pages_flushed',
'Innodb_buffer_pool_wait_free',
'Innodb_pages_written'
);
Calculate rates from intervals. Cumulative totals since startup do not prove a current bottleneck.
Choose a redo log size from service objectives
There is no universal “25% of buffer pool” rule. Select capacity by testing these constraints:
- Peak redo generation rate.
- Desired checkpoint breathing room during bursts.
- Sustained storage ability to flush dirty pages.
- Acceptable crash-recovery time.
- Available persistent disk and backup behavior.
- Version-specific resize support and operational window.
As a planning example, if a measured peak produces 80 MiB/s of redo and the target is ten minutes of checkpoint capacity:
80 MiB/s * 600 s = 48,000 MiB, approximately 46.9 GiB
That arithmetic is a starting hypothesis, not an instruction to deploy 47 GiB. Verify whether the peak is legitimate, whether storage can catch up afterward, how much of configured capacity becomes maximum checkpoint age, and whether crash recovery meets the RTO.
The MariaDB variable documentation permits a combined redo size up to 512 GiB and explicitly notes that a log may be larger than the buffer pool. Platform, edition, release, disk, and recovery constraints may impose a much lower practical limit.
Increase in measured steps. A change from 256 MiB directly to 64 GiB makes it difficult to learn which capacity solved the issue and can expand recovery exposure unnecessarily.
Resize safely on MariaDB 10.9 and newer
Community Server 10.9+ supports dynamic innodb_log_file_size. Confirm the version and current value:
SELECT VERSION();
SHOW GLOBAL VARIABLES LIKE 'innodb_log_file_size';
Set the tested target in bytes:
SET GLOBAL innodb_log_file_size = 4 * 1024 * 1024 * 1024;
This 4 GiB value is illustrative. A resize can take time. Monitor the session, server log, filesystem capacity, and runtime variable:
SHOW GLOBAL VARIABLES LIKE 'innodb_log_file_size';
SHOW ENGINE INNODB STATUSG
MariaDB documentation notes that a resize can be aborted by killing the connection executing SET GLOBAL. Do not treat that as a routine rollback; plan the change and let it complete unless an explicit abort criterion is reached.
Persist the successful value in an owned late-loading file:
[mariadb]
innodb_log_file_size = 4G
Verify parsed options:
mariadbd --print-defaults
my_print_defaults mariadbd server mysqld
Then verify persistence during the next planned restart. A runtime value without configuration reverts after restart; a configuration value that was never tested can surprise the next maintenance window.
MariaDB refuses a normal dynamic resize below innodb_log_buffer_size unless the log is on a persistent-memory filesystem. Check both values before shrinking.
Resize older Community Server releases with a restart
On Community Server 10.8 and older, innodb_log_file_size is not dynamic. Use the procedure documented for the exact release and rehearse it on a restored copy.
The safe high-level process is:
- Confirm backups and restore evidence.
- Stop application writes and drain connections.
- Make a clean MariaDB shutdown.
- Set the new size in a server option file.
- Start MariaDB and monitor startup and recovery.
- Verify runtime size, table access, writes, and replication.
systemctl stop mariadb
systemctl is-active mariadb
Edit the managed configuration through configuration management, then:
mariadbd --print-defaults
systemctl start mariadb
journalctl -u mariadb -b --no-pager
Do not delete, move, truncate, or recreate ib_logfile0 using a generic blog procedure. Redo files contain recovery state. File manipulation after an unclean shutdown can destroy the only information needed to recover committed changes. Follow the exact MariaDB release documentation, and escalate startup failures instead of improvising.
Understand innodb_log_buffer_size
The in-memory log buffer is separate from the on-disk redo capacity:
SHOW GLOBAL VARIABLES LIKE 'innodb_log_buffer_size';
SHOW GLOBAL STATUS LIKE 'Innodb_log_waits';
A larger buffer can help large transactions, bulk operations, or many concurrent writers generate redo between flushes without waiting for buffer space. It does not relax commit durability and does not replace innodb_log_file_size.
Investigate a rising Innodb_log_waits rate alongside transaction size and commit frequency. Often the better correction is to batch a massive transaction into restartable chunks. Smaller transactions reduce undo growth, lock duration, replication impact, rollback cost, and recovery complexity.
Example application pattern:
START TRANSACTION;
UPDATE billing.invoice_items
SET archived = 1
WHERE id > 1000000
AND id <= 1010000
AND archived = 0;
COMMIT;
The actual key ranges must be derived safely, progress must be recorded, and business atomicity must permit chunking. Never split a transaction whose correctness requires all rows to change together.
Define a transaction durability policy
Start from the data-loss objective, not a benchmark.
Durable production transactions
For systems where an acknowledged commit must survive a database process, operating-system, or host crash, the conventional baseline is:
[mariadb]
innodb_flush_log_at_trx_commit = 1
When the traditional binary log is enabled and crash-safe replication/PITR consistency matters:
[mariadb]
innodb_flush_log_at_trx_commit = 1
sync_binlog = 1
MariaDB's binary-log group commit can share synchronization work across transactions. Measure realistic concurrency before assuming sync_binlog=1 makes throughput unacceptable.
Deliberately relaxed durability
innodb_flush_log_at_trx_commit=2 may suit reconstructible caches, disposable ingest buffers, or explicitly lossy telemetry. It is not a harmless performance toggle. Document:
- Which acknowledged transactions may be lost.
- The failure scenarios included in the risk.
- How data will be reconstructed or reconciled.
- Whether binary logs and replicas can become inconsistent.
- Who approved the recovery-point objective.
- How clients handle replay and duplicate requests.
Do not use “replication protects us” as the sole argument. An asynchronous replica may receive a transaction that the primary later loses, or may lag behind; failover behavior depends on binlog and redo consistency.
Session-scoped exceptions
innodb_flush_log_at_trx_commit is global in MariaDB releases where commonly deployed, so it is not a convenient per-report toggle. Separate workloads with different durability contracts onto distinct instances or ingestion architectures rather than relaxing the entire transactional server for one batch job.
Coordinate redo durability with the binary log
Traditional MariaDB binary logging and InnoDB use a coordinated commit protocol. With the binary log enabled, verify both settings:
SELECT @@GLOBAL.log_bin,
@@GLOBAL.innodb_flush_log_at_trx_commit,
@@GLOBAL.sync_binlog,
@@GLOBAL.binlog_format;
For the strongest conventional crash durability and replication consistency, MariaDB documentation recommends both innodb_flush_log_at_trx_commit=1 and sync_binlog=1.
If sync_binlog=1 but redo is not flushed durably at commit, a crash can leave a transaction present in the binary log but missing from InnoDB. The reverse mismatch is also operationally important for replication and point-in-time recovery.
Newer MariaDB versions also offer an InnoDB-based binary log. When configured, sync_binlog is ignored and commit durability follows innodb_flush_log_at_trx_commit. It uses GTID positioning and has different files and operational characteristics. Do not apply traditional binlog assumptions without checking:
SHOW GLOBAL VARIABLES LIKE 'binlog_storage_engine';
Treat migration to this binlog implementation as a separate architecture change requiring compatibility, backup, replica, failover, tooling, and recovery testing.
Validate the storage durability chain
fsync() only provides the guarantee implemented by the layers beneath it. The chain can include:
- Container filesystem and volume driver.
- Guest kernel and virtual disk.
- Hypervisor cache mode.
- Host filesystem and device mapper.
- RAID controller cache.
- Drive write cache and firmware.
- Cloud block-storage service.
- Battery, capacitor, or power-loss protection.
Confirm vendor guarantees for flush/barrier propagation. A benchmark that reports very low durable commit latency may reveal excellent hardware or a cache that acknowledges volatile writes.
On Linux, gather topology and mount facts:
findmnt -T /var/lib/mysql
lsblk -o NAME,TYPE,SIZE,FSTYPE,MOUNTPOINTS,ROTA,MODEL
Do not change drive caches with hdparm, RAID tools, or cloud settings based on a generic command. Those operations are platform-specific and can put all data at risk.
The strongest test is a controlled power-loss or infrastructure-failure test in an isolated environment that mirrors production storage. kill -9 tests process death, not power failure. A VM reboot initiated cleanly by the platform may flush caches and prove even less.
Use current flush controls by MariaDB version
On Unix, MariaDB 10.6 changed the default innodb_flush_method to O_DIRECT. MariaDB 11.0 deprecated that umbrella variable and exposes explicit controls:
innodb_log_file_bufferinginnodb_data_file_bufferinginnodb_log_file_write_throughinnodb_data_file_write_through
These settings influence filesystem caching and write-through behavior, not the business durability policy by themselves. Leave defaults unless testing on the exact filesystem and storage stack shows a justified improvement.
SHOW GLOBAL VARIABLES LIKE 'innodb%file%buffering';
SHOW GLOBAL VARIABLES LIKE 'innodb%file%write_through';
The MariaDB documentation explicitly warns that disabling synchronization destroys crash-safety guarantees. Avoid unsafe debug synchronization settings in any environment containing valuable data.
Test commit latency without corrupting conclusions
A durability benchmark must use the same setting you intend to deploy. Compare:
- Transaction commits per second.
- P50, P95, P99, and maximum commit latency.
- Batch size and concurrent sessions.
Innodb_log_writes,Innodb_data_fsyncs, and log wait rates.- Device write latency and utilization.
- Checkpoint-age trajectory and dirty pages.
- Binary log configuration.
Autocommit turns every statement into a transaction unless explicitly grouped. Batching multiple logically related writes can reduce synchronization frequency:
START TRANSACTION;
INSERT INTO ledger.entries (...) VALUES (...);
INSERT INTO ledger.entries (...) VALUES (...);
UPDATE ledger.accounts SET ... WHERE id = ...;
COMMIT;
Batch only operations that form a valid atomic unit. Huge transactions trade fewer commits for longer locks, more undo, larger rollback, replication delay, and log pressure.
Avoid synthetic tests that fit entirely in caches, omit binary logging, use one connection when production has hundreds, or benchmark relaxed durability and then publish numbers as if they represented durable commits.
Plan and execute a crash-recovery test
Use an isolated clone with production-like data size and storage behavior.
- Restore a recent backup and validate it.
- Apply the proposed redo size and durability settings.
- Generate a representative write workload.
- Record transaction identifiers acknowledged to a separate durable observer.
- Trigger the chosen failure model.
- Start MariaDB and measure recovery time.
- Compare acknowledged IDs with recovered rows.
- Run application consistency checks.
- Validate binary logs, GTID state, replicas, and backup tooling.
- Repeat at different checkpoint ages and write intensities.
Do not test an unclean power interruption on the only copy of production data. A crash test is destructive by design and belongs in a disposable environment.
Measure from service unavailability to verified readiness, not merely until the mariadbd process exists. Recovery may accept connections before caches are warm enough to meet latency objectives.
Troubleshoot common redo and durability problems
Innodb_log_waits keeps increasing
Confirm the increase over an interval. Identify large transactions, bulk DML, long commit intervals, and concurrent writers. Consider safe transaction chunking and test a larger innodb_log_buffer_size. Do not confuse the buffer with redo-file capacity.
Checkpoint age stays near maximum
Measure redo generation and dirty-page flushing. Check storage saturation, background flushing configuration, write bursts, and large DML. Increase redo capacity only when storage can eventually catch up and crash recovery remains acceptable.
Commit latency spikes every few seconds
Correlate with device flush latency, group-commit batch size, binary-log rotation, checkpoints, virtualization pauses, and storage service limits. Do not relax durability until the storage path and workload have been diagnosed.
MariaDB will not start after a redo change
Stop repeated automated restarts and preserve logs:
systemctl status mariadb --no-pager
journalctl -u mariadb -b --no-pager
df -hT /var/lib/mysql
Verify configuration precedence, available disk, file ownership, mandatory access controls, and the exact error. Do not delete ib_logfile0. Restore the previous configuration only according to a rehearsed version-specific rollback, or recover from a validated backup if redo state has already been damaged.
A committed transaction disappeared after a host crash
Record innodb_flush_log_at_trx_commit, sync_binlog, binlog storage engine, storage cache guarantees, and logs before changing anything. Determine whether the documented policy allowed loss. Compare application acknowledgements, primary data, binary log, replicas, and external side effects. This is an incident requiring reconciliation, not merely a tuning ticket.
Redo disk usage is larger than expected
Check the runtime variable, release, number of redo files, path, and whether old files belong to a previous layout. Never remove files based only on their names. Ask MariaDB and inspect startup logs to determine what is active.
Dynamic resize appears stuck
Monitor the executing connection, logs, free space, I/O pressure, and runtime variable. Avoid starting another resize. If an abort is required, follow the documented method and verify server health before retrying with a smaller operational step.
Roll out and roll back safely
A production rollout should have a change record containing:
- Exact server version and edition.
- Existing and target redo size.
- Existing and target flush and binlog settings.
- Peak redo generation and checkpoint-age evidence.
- Storage headroom and latency baseline.
- Tested recovery time and data-loss result.
- Replica, Galera, backup, and PITR impact.
- Success metrics, abort thresholds, owner, and timeline.
Resize one topology member at a time where architecture permits. Verify replication state and application health before continuing. In a Galera cluster, transaction certification, wsrep provider behavior, state transfers, and cluster recovery add constraints; test cluster-specific guidance rather than treating every node as an independent asynchronous replica.
For a dynamic size rollback on supported versions, set the previous tested value only after confirming it is not below the log buffer and enough checkpoint progress exists. Persist the old value as well. A shrink can impose work and should not be triggered during peak load merely because a dashboard regressed.
For durability-policy rollback, remember that changing a global value affects subsequent behavior, not transactions already acknowledged under the relaxed policy. Restoring 1 cannot recreate lost data or repair a binlog mismatch after a crash.
Monitor the durable write path
Build interval-based dashboards for:
- Redo bytes generated per second.
- Checkpoint age and checkpoint-age utilization.
Innodb_log_waitsrate.- Redo writes and fsync rate.
- Dirty pages and pages flushed per second.
- Commit latency percentiles and transaction rate.
- Storage latency, queue depth, utilization, errors, and free capacity.
- Binary log bytes, group commits, rotations, and disk use.
- Replica lag, GTID health, and cluster status.
- Restart recovery duration from controlled tests and real events.
Alert when checkpoint utilization stays high with rising latency, when log waits appear, when durable commit latency breaches the service objective, or when storage no longer has capacity for a resize and normal growth.
Avoid alerting on one absolute redo size across all servers. A 1 GiB log can be generous for a small service and dangerously small for a high-throughput ingest node.
Best practices checklist
- Query the actual version and runtime variables before using a procedure.
- Keep redo, binary log, backup, and undo concepts separate.
- Measure peak redo generation over representative intervals.
- Read checkpoint age as bytes, not time.
- Size for burst absorption, sustainable flushing, and tested recovery time.
- Use dynamic resize only where the installed edition and version support it.
- Persist runtime resize values in managed configuration.
- Never delete or truncate
ib_logfile0as a routine resize step. - Use
innodb_flush_log_at_trx_commit=1for acknowledged durable transactions. - Coordinate traditional binlog durability with
sync_binlog=1when required. - Document and approve any intentional data-loss window.
- Validate flush propagation through the entire storage stack.
- Test process crash and infrastructure failure as distinct scenarios.
- Benchmark production durability settings with realistic concurrency.
- Roll out gradually with an explicit abort and recovery procedure.
FAQ
What does the MariaDB redo log contain?
It contains physical change records InnoDB uses to recover data pages after a crash. It is circular internal storage, not a replacement for binary logs or backups.
Does a larger redo log improve performance?
It can reduce forced checkpoint activity during write bursts. It does not improve every workload and may expand worst-case crash-recovery work, so measure redo rate and recovery time.
Can MariaDB resize innodb_log_file_size online?
MariaDB Community Server supports dynamic resizing from 10.9. Earlier Community releases require a restart-based, version-specific procedure. Always verify edition and version.
Is innodb_flush_log_at_trx_commit=2 safe?
It is crash-consistent but not fully durable for acknowledged commits. A host or OS failure can lose recent transactions, potentially more than the commonly quoted one second.
Why is sync_binlog important?
With the traditional binary log, sync_binlog=1 synchronizes it at each event group and, together with durable InnoDB flushing, provides the strongest conventional crash and replication consistency.
Does kill -9 prove power-loss durability?
No. It tests database-process death while the OS and storage remain alive. Power loss tests whether filesystem, hypervisor, controller, and drive caches honor durability guarantees.
Should innodb_log_file_size be smaller than the buffer pool?
Not necessarily. Current MariaDB documentation permits it to be larger. Choose it from redo generation, checkpoint behavior, disk capacity, and recovery objectives rather than a fixed ratio.
Can a replica compensate for relaxed primary durability?
Not reliably. Asynchronous lag and redo/binlog ordering can leave different nodes with different transaction sets after a crash. Durability and failover policy must be designed together.
Conclusion
Production MariaDB redo log tuning starts with a durability promise. Decide whether an acknowledged commit must survive each failure class, configure redo and binary-log synchronization accordingly, and verify that the underlying storage honors flushes. Performance numbers obtained under a weaker promise are not comparable.
Then size capacity from measured redo generation, checkpoint behavior, sustainable storage throughput, and tested recovery time. Use version-aware online resize where available, persist the value, monitor the operation, and never manipulate ib_logfile0 casually. The best configuration is not the largest log or the fewest fsyncs; it is the smallest operational risk that consistently meets throughput, RPO, and RTO requirements.
Suggested Internal Links
- Size the MariaDB InnoDB Buffer Pool for Production
- Tune MariaDB Temporary Tables and Sort Operations Safely
- Understand MariaDB Configuration Files and Precedence
- Configure MariaDB Connections and Thread Handling
- Back Up MariaDB with mariadb-backup
- Configure MariaDB Binary Logs for Point-in-Time Recovery