14.5.4 Log Buffer

kakaxi9521發表於2021-06-27

14.5.4 Log Buffer

The log buffer is the memory area that holds data to be written to the log files on disk. Log buffer size is defined by the  innodb_log_buffer_size variable. The default size is 16MB. The contents of the log buffer are periodically flushed to disk. A large log buffer enables large transactions to run without the need to write redo log data to disk before the transactions commit. Thus, if you have transactions that update, insert, or delete many rows, increasing the size of the log buffer saves disk I/O.


Log Buffer是記憶體中不同於Buffer Pool 的一部分會快取將寫入到磁碟中的資料。 Log Buffer的大小可用innodb_log_buffer_size 引數設定。 預設大小是16MB。 Log Buffer 的內容會週期性的重新整理到磁碟。 大的Log Buffer 可以容納大的事務無需將資料寫入到redo 日誌,減少與磁碟的互動。 事務中如果有大量的dml 操作,可以考慮增大Log Buffer的值,減少磁碟IO。


The  innodb_flush_log_at_trx_commit variable controls how the contents of the log buffer are written and flushed to disk. The  innodb_flush_log_at_timeout variable controls log flushing frequency.


innodb_flush_log_at_trx_commit 引數能夠控制 log buffer 寫入和重新整理到磁碟。

innodb_flush_log_at_timeout 引數能控制重新整理的頻率。


For related information, see  Memory Configuration, and  Section 8.5.4, “Optimizing InnoDB Redo Logging”.


參考文章:

https://dev.mysql.com/doc/refman/5.7/en/innodb-redo-log-buffer.html



來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/21374452/viewspace-2778501/,如需轉載,請註明出處,否則將追究法律責任。

相關文章