溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

MySQL管理之道-筆記-MySQL5.7-在線調(diào)整innodb_buffer_pool_size

發(fā)布時(shí)間:2020-05-29 11:06:05 來源:網(wǎng)絡(luò) 閱讀:3044 作者:aix6180 欄目:MySQL數(shù)據(jù)庫

在線調(diào)整innodb_buffer_pool_size不用重啟mysql進(jìn)程
MySQL5.7以前,調(diào)整innodb_buffer_pool_size需要重啟mysql進(jìn)程才可以生效。
建議業(yè)務(wù)低峰時(shí)間執(zhí)行

1 當(dāng)前大小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 動(dòng)態(tài)調(diào)整為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)

調(diào)整時(shí),內(nèi)部會(huì)把數(shù)據(jù)頁移動(dòng)到一個(gè)新的位置,單位是塊。如果想提升移動(dòng)速度,則需要調(diào)整
innodb_buffer_pool_chunk_size的參數(shù)大小,默認(rèn)是128M

innodb_buffer_pool_size/innodb_buffer_pool_instances = innodb_buffer_pool_chunk_size的參數(shù)大小,默認(rèn)是128M

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI