私たちは最近、 MySQLのチューニングをして、もう2つの便利なツールaccossに興味があるかもしれないが走った:
- mysqltuner.pl
- チューニング- primer.sh
両方のMySQLの場合はこれらのスクリプトのチューニングはかなり便利です。ここのいくつかのサンプル出力ですmysqltuner.pl
コード:
>> MySQLTuner 0.9.8 - Major Hayden <major@mhtx.net>
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering
-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.0.51a-3ubuntu5.1-log
[OK] Operating on 32-bit architecture with less than 2GB RAM
-------- Storage Engine Statistics -------------------------------------------
[--] Status: +Archive -BDB -Federated -InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 525M (Tables: 385)
[--] Data in MEMORY tables: 1M (Tables: 4)
[!!] Total fragmented tables: 19
-------- Performance Metrics -------------------------------------------------
[--] Up for: 2h 48m 41s (562K q [55.592 qps], 48K conn, TX: 177M, RX: 164M)
[--] Reads / Writes: 77% / 23%
[--] Total buffers: 3.0M per thread and 354.0M global
[OK] Maximum possible memory usage: 1.5G (76% of installed RAM)
[OK] Slow queries: 3% (21K/562K)
[OK] Highest usage of available connections: 7% (29/400)
[OK] Key buffer size / total MyISAM indexes: 128.0M/309.2M
[OK] Key buffer hit rate: 100.0%
[OK] Query cache efficiency: 60.6%
[OK] Query cache prunes per day: 0
[!!] Sorts requiring temporary tables: 13%
[OK] Temporary tables created on disk: 12%
[OK] Thread cache hit rate: 99%
[OK] Table cache hit rate: 94%
[OK] Open file limit used: 44%
[OK] Table locks acquired immediately: 99%
-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
MySQL started within last 24 hours - recommendations may be inaccurate
Variables to adjust:
sort_buffer_size (> 1M)
read_rnd_buffer_size (> 524K)