There are 3 different configuration is available for innodb_flush_log_at_trx_commit

innodb_flush_log_at_trx_commit = 0

innodb_flush_log_at_trx_commit = 1

innodb_flush_log_at_trx_commit = 2

Which is the best configuration for innodb_flush_log_at_trx_commit?

what is the difference between this three configuration?

1 Answer 1


innodb_flush_log_at_trx_commit has default value of 1 - To disk on each transaction commit. is extremely expensive. Your applications can get incredible performance boost if you change the value to 2 - To OS cache on each transaction commit. To disk every second.

With a value of 2, only an operating system crash or a power outage can erase the last second of transactions. However, InnoDB's crash recovery is not affected and thus crash recovery does work regardless of the value.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.