Tutorials Courses Interview Prep (100 Q&A) AI Tools (50) Developer Tools (50) Tracks Pricing Plans Blog & Articles Contact Us
MySQL Tuning, Indexing & Concurrency 8-10 Years (Tech Lead) Hard Production Scenario

How does `innodb_flush_log_at_trx_commit` trade ACID durability for 10x write throughput?

Real-World Scenario / Incident Description

A high-speed IoT ingestion pipeline writing 20,000 metrics per second was bottlenecked by disk IOPS.

117 views • Updated 1 month ago

innodb_flush_log_at_trx_commit Settings

  • 1 (Default / Strict ACID): Redo log is flushed to disk on every single transaction commit. Maximum safety, high disk IOPS.
  • 2: Redo log is written to OS cache on commit and flushed to disk once per second. If OS crashes, at most 1 second of data is lost, but write throughput increases up to 10x.
  • 0: Flushed once per second in memory.
Related Concepts: #ACID #Redo Log #IOPS #Tuning