14.6.3.5 Configuring InnoDB Buffer Pool Prefetchin

A read-ahead request is an I/O request to prefetch multiple pages in the buffer pool asynchronously, in anticipation that these pages will be needed soon. The requests bring in all the pages in one extent. InnoDB uses two read-ahead algorithms to improve I/O performance:
预读请求是一个 I/O请求,用于异步预取缓冲池中的多个页面,预期这些页面将很快被需要。请求在一个extent内引入所有页面。 InnoDB使用两种预读算法来提高I/O性能:
Linear read-ahead is a technique that predicts what pages might be needed soon based on pages in the buffer pool being accessed sequentially. You control when InnoDB performs a read-ahead operation by adjusting the number of sequential page accesses required to trigger an asynchronous read request, using the configuration parameterinnodb_read_ahead_threshold. Before this parameter was added, InnoDB would only calculate whether to issue an asynchronous prefetch request for the entire next extent when it read in the last page of the current extent.
Linear 预读是一种技术,可以根据顺序访问的缓冲池中的页面快速预测可能需要的页面。您可以通过调整触发异步读取请求所需的顺序页面访问次数来控制InnoDB何时执行预读操作,方法是使用配置参数innodb_read_ahead_threshold,在添加此参数之前,InnoDB只会计算在读取当前extent的最后一页时是否对整个下一个extent发出异步预取请求。
The configuration parameter innodb_read_ahead_threshold controls how sensitive InnoDB is in detecting patterns of sequential page access. If the number of pages read sequentially from an extent is greater than or equal toinnodb_read_ahead_threshold, InnoDB initiates an asynchronous read-ahead operation of the entire following extent.innodb_read_ahead_threshold can be set to any value from 0-64. The default value is 56. The higher the value, the more strict the access pattern check. For example, if you set the value to 48, InnoDB triggers a linear read-ahead request only when 48 pages in the current extent have been accessed sequentially. If the value is 8, InnoDB triggers an asynchronous read-ahead even if as few as 8 pages in the extent are accessed sequentially. You can set the value of this parameter in the MySQL configuration file, or change it dynamically with the SET GLOBAL command, which requires the SUPER privilege.
配置参数innodb_read_ahead_threshold控制InnoDB在检测连续页面访问模式方面的敏感程度.如果从某个extent顺序读取的页数大于或等于innodb_read_ahead_threshold,则InnoDB会启动整个后续extent的异步预读操作.innodb_read_ahead_threshold可以设置为0-64之间的任何值。 默认值是56,值越高,访问模式检查越严格。 例如,如果将该值设置为48,只有当顺序访问当前extent中的48个页面时,InnoDB才会触发线性预读请求。.如果值为8,即使在顺序访问范围中只有8个页面,InnoDB也会触发异步预读.您可以在MySQL配置文件中设置此参数的值,或者使用需要SUPER权限的SET GLOBAL命令动态更改它。
Random read-ahead is a technique that predicts when pages might be needed soon based on pages already in the buffer pool, regardless of the order in which those pages were read. If 13 consecutive pages from the same extent are found in the buffer pool, InnoDB asynchronously issues a request to prefetch the remaining pages of the extent. To enable this feature, set the configuration variable innodb_random_read_ahead to ON.
Random 预读是一种技术,可根据缓冲池中已有的页面快速预测何时需要页面,而不管这些页面的读取顺序如何,如果在缓冲池中找到了来自相同extent的连续13个页面,则InnoDB会异步发出请求以预取该extent的其余页面。 要启用此功能,请将配置变量innodb_random_read_ahead设置为ON。
The SHOW ENGINE INNODB STATUS command displays statistics to help you evaluate the effectiveness of the read-ahead algorithm. Statistics include counter information for the following global status variables:
SHOW ENGINE INNODB STATUS命令显示统计信息,以帮助您评估预读算法的有效性。 统计数据包括以下全局状态变量的计数器信息:

  • Innodb_buffer_pool_read_ahead
  • Innodb_buffer_pool_read_ahead_evicted
  • Innodb_buffer_pool_read_ahead_rnd

This information can be useful when fine-tuning the innodb_random_read_ahead setting.
这些信息在微调innodb_random_read_ahead设置时非常有用。
For more information about I/O performance, see Section 8.5.8, “Optimizing InnoDB Disk I/O” and Section 8.12.2, “Optimizing Disk I/O”.
有关I/O性能的更多信息,请参见Section 8.5.8, “Optimizing InnoDB Disk I/O” 和第Section 8.12.2, “Optimizing Disk I/O”.

PREV: 14.6.3.4 Making the Buffer Pool Scan Resistant https://blog.51cto.com/itzhoujun/2355879
NEXT: 14.6.3.6 Configuring InnoDB Buffer Pool Flushing https://blog.51cto.com/itzhoujun/2355882

上一篇:算法之Python实现 - 000


下一篇:14.6.3 InnoDB Buffer Pool Configuration