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:
PLAIN TEXT CODE:
- mysql> set global innodb_max_dirty_pages_pct = 0;
Now run the following command:
…
[Read more]