In earlier versions, if a high-load machine is restarted and a large amount of hot data in the memory is cleared, it will re-load the data from the disk to the Buffer_Pool buffer pool, in this way, the performance will become very poor during peak hours,
In earlier versions, if a high-load machine is restarted and a large amount of hot data in the memory is cleared, it will re-load the data from the disk to the Buffer_Pool buffer pool, in this way, the performance will become very poor during peak hours,
In earlier versions, if a high-load machine is restarted and a large amount of hot data in the memory is cleared, the U.S. space will be reloaded from the disk to the Buffer_Pool buffer pool, in this way, the performance will become very poor during peak hours, and the number of connections on the U.S. server will be very high.
In MySQL5.6, this problem is avoided by a new feature.
You only need to add the following in my. cnf:
Innodb_buffer_pool_dump_at_shutdown = 1
Explanation: dump hot data to a local disk when it is disabled.
Innodb_buffer_pool_dump_now = 1
Explanation: manually dumping hot data to a local disk.
Innodb_buffer_pool_load_at_startup = 1
Explanation: Load hot data to the memory at startup.
Innodb_buffer_pool_load_now = 1
Explanation: manually load hot data to the memory.
When MySQL is disabled, the hot data in the memory is stored in the ib_buffer_pool file on the disk, which is located in the data directory.
View the log and you will find:
After the instance is started, hot data is automatically loaded to the Buffer_Pool buffer pool.
View the log and you will find:
In this way, keep the hot data in the memory.
Note: Hot data will be dump to the memory only when the MySQL service is shut down normally, the US server, or pkill mysql. If the machine goes down or pkill-9 mysql, it will not dump.
This article is from the "hechun's technical column" blog. Be sure to keep this source