在 PERCONA MYSQL PERFORMANCE BLOG 看到這篇文章, 覺得很不錯, 其中在文章開始時作者提到一些建議很實用。
— Change one setting at a time! This is the only way to estimate if a change is beneficial.
— Most settings can be changed at runtime with SET GLOBAL. It is very handy and it allows you to quickly revert the change if it creates any problem. But in the end, you want the setting to be adjusted permanently in the configuration file.
— A change in the configuration is not visible even after a MySQL restart? Did you use the correct configuration file? Did you put the setting in the right section? (all settings in this post belong to the [mysqld] section)
— The server refuses to start after a change: did you use the correct unit? For instance, innodb_buffer_pool_size should be set in bytes while max_connection is dimensionless.
— Do not allow duplicate settings in the configuration file. If you want to keep track of the changes, use version control.
— Don’t do naive math, like “my new server has 2x RAM, I’ll just make all the values 2x the previous ones”..
這些建議不單單適用在 MySQL, 在其他地方修改設定同樣也適用。