0和2都是每秒從緩沖區(qū)寫(xiě)入文件一次。區(qū)別是commit操作時(shí),0不做任何操作,為2 的時(shí)候,commit時(shí)會(huì)把緩沖區(qū)內(nèi)容寫(xiě)入文件。文檔上是這么寫(xiě)的: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.
2016-12-21
0和2都是每秒從緩沖區(qū)寫(xiě)入文件一次。區(qū)別是commit操作時(shí),0不做任何操作,為2 的時(shí)候,commit時(shí)會(huì)把緩沖區(qū)內(nèi)容寫(xiě)入文件。文檔上是這么寫(xiě)的: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.
2016-02-23
0是每秒刷一次磁盤(pán),1是每一個(gè)事務(wù)提交后都要刷一次磁盤(pán),2是提交事務(wù)后記錄但是不刷盤(pán)。