在线调整innodb_buffer_pool_size不用重启Mysql进程mysql5.7以前,调整innodb_buffer_pool_size需要重启mysql进程才可以生效。建议业务低峰时间执行 1
在线调整innodb_buffer_pool_size不用重启Mysql进程
mysql5.7以前,调整innodb_buffer_pool_size需要重启mysql进程才可以生效。
建议业务低峰时间执行
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
--结束END--
本文标题: MySQL管理之道-笔记-MySQL5.7-在线调整innodb_buffer_pool_size
本文链接: https://lsjlt.com/news/35670.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-10-23
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0