admin管理员组

文章数量:1642498

文章目录

  • 1 问题背景
  • 2 回顾
  • 3 日志缓冲区

1 问题背景

前面研究了InnoDB内存架构之自适应Hash索引,今天研究下日志缓冲区。

2 回顾

InnoDB内存架构如下图所示:

3 日志缓冲区

原文
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.

日志缓冲区在内存区域中,该区域存储的数据将被写入到磁盘上的日志文件。innodb_log_buffer_size变量表示日志缓冲区的大小,默认大小是16MB。日志缓冲区的内容会稍后刷新到磁盘中。一个巨大的日志缓冲区允许运行大量的事务时,在事务提交前无需写入redo日志数据到磁盘上。因此,如果你有更新、插入或者删除多行的事务,需要增加日志缓冲区的大小来降低磁盘IO

本文标签: 缓冲区架构内存日志innodb