How to decrease InnoDB shutdown times

from: http://www.mysqlperformanceblog.com/2009/04/15/how-to-decrease-innodb-shutdown-times/


Sometimes a MySQL server running InnoDB takes a long time to shut down. The usual culprit is flushing dirty pages from the buffer pool. These are pages that have been modified in memory, but not on disk.

If you kill the server before it finishes this process, it will just go through the recovery phase on startup, which can be even slower in stock InnoDB than the shutdown process, for a variety of reasons.

One way to decrease the shutdown time is to pre-flush the dirty pages, like this:

mysql> set global innodb_max_dirty_pages_pct = 0;
 

Now run the following command:

$ mysqladmin ext -i10 | grep dirty
| Innodb_buffer_pool_pages_dirty    | 1823484        |
| Innodb_buffer_pool_pages_dirty    | 1821293        |
| Innodb_buffer_pool_pages_dirty    | 1818938        |
 

And wait until it approaches zero. (If the server is being actively used, it won’t get to zero.)

Once it’s pretty low, you can perform the shutdown and there’ll be a lot less unfinished work to do, so the server should shut down more quickly.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值