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.
2016-12-21
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.
2016-02-23
0是每秒刷一次磁盤,1是每一個事務提交后都要刷一次磁盤,2是提交事務后記錄但是不刷盤。