Speedup MySQL InnoDB shutdown

Depending on the size of the databases you have in mysql innodb the time it takes mysql to restart can be horribly slow (for very big innodb databases). There are some tricks that can speed this up, but the most effective one that I’ve found and use all the time in similar situations is to pre-flush the dirty pages right before shutdown; this can be done like this:

mysql> set global innodb_max_dirty_pages_pct = 0;

You can check the number of dirty pages with the command:

mysqladmin ext -i10 | grep dirty

Let the server run like this for a while and after you see it settle in, the restart (or stop) should be much faster.

comments powered by Disqus