ITPub博客

首页 > 数据库 > MySQL > 14.5.4 Log Buffer

14.5.4 Log Buffer

翻译 MySQL 作者:kakaxi9521 时间:2021-06-27 11:20:20 0 删除 编辑

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博客 ” ,链接:https://blog.itpub.net/21374452/viewspace-2778501/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-04-13

  • 博文量
    136
  • 访问量
    178998