为了账号安全,请及时绑定邮箱和手机立即绑定

没听懂innodb_fulsh_log_at_trx_commit 值为0和2的区别是啥

好像都是一秒以后刷新到磁盘,是2会先刷到缓存里么,那0的时候一秒以后直接刷磁盘?

正在回答

2 回答

0和2都是每秒从缓冲区写入文件一次。区别是commit操作时,0不做任何操作,为2 的时候,commit时会把缓冲区内容写入文件。文档上是这么写的:If the value of innodb_flush_log_at_trx_commit is 0, the log buffer is written out to the log file once per second and the flush to disk operation is performed on the log file, but nothing is done at a transaction commit.. When the value is 2, the log buffer is written out to the file at each commit, but the flush to disk operation is not performed on it. However, the flushing on the log file takes place once per second also when the value is 2.

0 回复 有任何疑惑可以回复我~
#1

英宁 提问者

非常感谢!
2017-03-21 回复 有任何疑惑可以回复我~

0是每秒刷一次磁盘,1是每一个事务提交后都要刷一次磁盘,2是提交事务后记录但是不刷盘。

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

没听懂innodb_fulsh_log_at_trx_commit 值为0和2的区别是啥

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信