其他分享
首页 > 其他分享> > 14.6.3.1 The InnoDB Buffer Pool

14.6.3.1 The InnoDB Buffer Pool

作者:互联网

InnoDB maintains a storage area called the buffer pool for caching data and indexes in memory. Knowing how the InnoDB buffer pool works, and taking advantage of it to keep frequently accessed data in memory, is an important aspect of MySQL tuning. For information about how the InnoDB buffer pool works, see InnoDB Buffer Pool LRU Algorithm.
InnoDB维护一个称为缓冲池的存储区域,用于在内存中缓存数据和索引。了解InnoDB缓冲池如何工作,并利用它来将频繁访问的数据保存在内存中,这是MySQL调优的一个重要方面,有关InnoDB缓冲池如何工作的信息,请看 InnoDB Buffer Pool LRU Algorithm.

You can configure the various aspects of the InnoDB buffer pool to improve performance.
您可以配置InnoDB缓冲池的各个方面以提高性能。

InnoDB Buffer Pool LRU Algorithm

InnoDB manages the buffer pool as a list, using a variation of the least recently used (LRU) algorithm. When room is needed to add a new page to the pool, InnoDB evicts the least recently used page and adds the new page to the middle of the list. This “midpoint insertion strategy” treats the list as two sublists:
InnoDB使用最近最少使用(LRU)算法的变体,将缓冲池作为列表来管理。当需要空间将新页面添加到池中时,InnoDB会驱逐最近最少使用的页面,并将新页面添加到列表的中间,这种“中点插入策略”将列表视为两个子列表:

This algorithm keeps pages that are heavily used by queries in the new sublist. The old sublist contains less-used pages; these pages are candidates for eviction.
此算法将查询大量使用的页面保留在新子列表中。 旧子列表包含较少使用的页面; 这些页面是被驱逐的候选页面。
The LRU algorithm operates as follows by default:
LRU算法默认运行如下:

By default, pages read by queries immediately move into the new sublist, meaning they stay in the buffer pool longer. A table scan (such as performed for a mysqldump operation, or a SELECT statement with no WHERE clause) can bring a large amount of data into the buffer pool and evict an equivalent amount of older data, even if the new data is never used again. Similarly, pages that are loaded by the read-ahead background thread and then accessed only once move to the head of the new list. These situations can push frequently used pages to the old sublist, where they become subject to eviction. For information about optimizing this behavior, see Section 14.6.3.4, “Making the Buffer Pool Scan Resistant”, and Section 14.6.3.5, “Configuring InnoDB Buffer Pool Prefetching (Read-Ahead)”.
默认情况下,查询读取的页面会立即移动到新的子列表中,这意味着它们会留在缓冲池中的时间更长。表扫描(例如执行mysqldump操作,或者不带WHERE子句的SELECT语句)可以将大量数据带入缓冲池并驱逐等量的旧数据,即使新数据再也不会使用。类似地,由预读后台线程加载然后仅访问一次的页面移动到新列表的头部。 这些情况可以将经常使用的页面推送到旧的子列表,在那里它们会被驱逐,有关优化此行为的信息请看 Section 14.6.3.4, “Making the Buffer Pool Scan Resistant”,和 Section 14.6.3.5, “Configuring InnoDB Buffer Pool Prefetching (Read-Ahead)”.
InnoDB Standard Monitor output contains several fields in the BUFFER POOL AND MEMORY section that pertain to operation of the buffer pool LRU algorithm. For details, see Section 14.6.3.9, “Monitoring the Buffer Pool Using the InnoDB Standard Monitor”.
InnoDB标准监视器输出包含BUFFER POOL AND MEMORY 节中关于缓冲池LRU算法操作的几个字段。更多信息请看 Section 14.6.3.9, “Monitoring the Buffer Pool Using the InnoDB Standard Monitor”.

InnoDB Buffer Pool Configuration Options

InnoDB缓冲池配置选项

Several configuration options affect different aspects of the InnoDB buffer pool.
几个配置选项影响InnoDB缓冲池的不同方面。

标签:14.6,Buffer,buffer,InnoDB,pool,innodb,Pool
来源: https://blog.51cto.com/itzhoujun/2355337