MySQL管理之道-笔记-MySQL5.7-在线调整innodb_buffer_pool_size
在线调整innodb_buffer_pool_size不用重启MySQL进程
MySQL5.7以前,调整innodb_buffer_pool_size需要重启mysql进程才可以生效。
建议业务低峰时间执行
班玛网站建设公司创新互联公司,班玛网站设计制作,有大型网站制作公司丰富经验。已为班玛上1000+提供企业网站建设服务。企业网站搭建\成都外贸网站制作要多少钱,请找那个售后服务好的班玛做网站的公司定做!
1 当前大小128M
root@localhost:mysql3306.sock [(none)]>show variables like '%innodb_buffer_pool_size%';
+-------------------------+-----------+
| Variable_name | Value |
+-------------------------+-----------+
| innodb_buffer_pool_size | 134217728 |
+-------------------------+-----------+
row in set (0.03 sec)
root@localhost:mysql3306.sock [(none)]>select 134217728/1024/1024;
+---------------------+
| 134217728/1024/1024 |
+---------------------+
| 128.00000000 |
+---------------------+
row in set (0.00 sec)
2 动态调整为256M
root@localhost:mysql3306.sock [(none)]>set global innodb_buffer_pool_size = 256*1024*1024;
Query OK, 0 rows affected (0.18 sec)
root@localhost:mysql3306.sock [(none)]>show variables like '%innodb_buffer_pool_size%';
+-------------------------+-----------+
| Variable_name | Value |
+-------------------------+-----------+
| innodb_buffer_pool_size | 268435456 |
+-------------------------+-----------+
row in set (0.02 sec)
root@localhost:mysql3306.sock [(none)]>select 268435456/1024/1024;
+---------------------+
| 268435456/1024/1024 |
+---------------------+
| 256.00000000 |
+---------------------+
row in set (0.00 sec)
root@localhost:mysql3306.sock [(none)]>select version();
+------------+
| version() |
+------------+
| 5.7.18-log |
+------------+
row in set (0.03 sec)
调整时,内部会把数据页移动到一个新的位置,单位是块。如果想提升移动速度,则需要调整
innodb_buffer_pool_chunk_size的参数大小,默认是128M
innodb_buffer_pool_size/innodb_buffer_pool_instances = innodb_buffer_pool_chunk_size的参数大小,默认是128M
当前名称:MySQL管理之道-笔记-MySQL5.7-在线调整innodb_buffer_pool_size
网页URL:http://scyanting.com/article/jjssjp.html