วันศุกร์ที่ 30 สิงหาคม พ.ศ. 2556

How to MySQLTuner

http://www.ovaistariq.net/358/tuning-mysql-server-settings/
http://www.ovaistariq.net/496/tuning-innodb-configuration/


http://dev.mysql.com/doc/refman/5.5/en/server-parameters.html
When tuning a MySQL server, the two most important variables to configure are key_buffer_size andtable_open_cache. You should first feel confident that you have these set appropriately before trying to change any other variables.


http://www.howtoforge.com/tuning-mysql-performance-with-mysqltuner

http://rtcamp.com/wordpress-nginx/tutorials/mysql/mysqltuner/
1. Run mysqltuner after 24 hours. If you don't, it will remind you by showing “MySQL started within last 24 hours ? recommendations may be inaccurate.” Reason: mysqltuner recommendation may prove inaccurate.

2. If it asks you to change value of tmp_table_size or max_heap_table_size variable, make sure you change both and keep them equal. These are global values so feel free to increase them by large chunks (provided you have enough memory on server)

3. If it asks you to tweak join_buffer_size, tweak in small chunks as it will be multiplied by value of max_connections.

4. If it asks you to increase innodb_buffer_pool_size, make it large. Ideally, it should be large enough to accommodate your all innodb databases. If you do not have enough RAM consider buying some. Otherwise try to delete unwanted database. Do not ignore this as it can degrade performance significantly.

5. Try to keep maximum possible memory less than 50%. Other lines can tell you, if your site is using too “less” mysql connections. In that case, you can reduce max_connections and increase other buffers more generously.

6. Also, whenever you make changes to mysql config and restart mysql server, always run mysqltuner immediately to check if by mistake you haven’t made maximum possible memory usage too high! Ignore any other suggestion it will give for next 24-hours!

7. As we use mysqltuner many times, it will be convenient to create hidden .my.cnf file in your home-dir. Do not confuse this with mysql-server’s my.cnf file.
Create file ~/.my.cnf and add following lines in it and replace mysqluser & mysqlpass values.
[client]
user=mysqluser
pass=mysqlpass
For safety, make this file readable to you only by running chmod 0600 ~/.my.cnf
Now on next run, mysqltuner will not ask you for password.

ไม่มีความคิดเห็น:

แสดงความคิดเห็น