MySQL5.7新特性:innodb-buffer-pool-size新特性

MySQL 5.7.5后Innodb_buffer_pool_size一方面可以动态分配。但另一方面也引入了一个新特性。 bp分配必须是innodb_buffer_pool_chunk_size的倍数。同时最好是:innodb_buffer_pool_chunk_size*innodb_buffer_pool_instances.
innodb_buffer_pool_chunk_size默认是128M.

所以于MySQL5.7.5对于Buffer的分配需要提前计算一下。 尽量让innodb_buffer_pool_size = innodb_buffer_pool_chunk_size * innodb_buffer_pool_instances 从而获取一个较佳的性能。

下面是5.7的官方文档,比较详细:

 innodb_buffer_pool_chunk_size

Introduced 5.7.5
Command-Line Format --innodb_buffer_pool_chunk_size
System Variable Name innodb_buffer_pool_chunk_size
Variable Scope Global
Dynamic Variable No
Permitted Values Type integer
Default 134217728
Min Value 1048576
Max Value innodb_buffer_pool_size / innodb_buffer_pool_instances

innodb_buffer_pool_chunk_size defines the chunk size for online InnoDB buffer pool resizing operations.

As of MySQL 5.7.5, the innodb_buffer_pool_size parameter is dynamic, which allows you to resize the buffer pool without restarting the server. To avoid copying all buffer pool pages during resizing operations, the operation is performed in chunks. Chunk size is defined byinnodb_buffer_pool_chunk_size. By default, innodb_buffer_pool_chunk_size is 128MB (134217728 bytes). The number of pages contained in a chunk depends on the value of innodb_page_sizeinnodb_buffer_pool_chunk_size can be increased or decreased in units of 1MB (1048576 bytes).

The following conditions apply when altering the innodb_buffer_pool_chunk_size value:

Important

Care should be taken when changing innodb_buffer_pool_chunk_size, as changing this value can automatically increase the size of the buffer pool. Before you change innodb_buffer_pool_chunk_size, calculate the effect it will have oninnodb_buffer_pool_size to ensure that the resulting buffer pool size is acceptable.

To avoid potential performance issues, the number of chunks (innodb_buffer_pool_size / innodb_buffer_pool_chunk_size) should not exceed 1000.


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值