Mysql Performance Optimization script mysqltuner. pl usage introduction bitsCN.com
MySQLTuner: http://github.com/rackerhacker/MySQLTuner-perl
MySQLTuner usage:
Downloading and using MySQLTuner is actually a very simple process:
Wget mysqltuner. pl
Perl mysqltuner. pl
If you 'd rather not invoke perl every time, just make it executable:
Chmod u + x mysqltuner. pl
./Mysqltuner. pl
» Latest development version
If you want to get the bleeding edge commits, you can check out the latest code with git:
Git clone git: // github.com/rackerhacker/MySQLTuner-perl.git
View my running results
> MySQLTuner 1.1.1-Major Hayden
> 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.1.43-log
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -------------------------------------------
[--] Status:-Archive-BDB-Federated-InnoDB-ISAM-NDBCluster
[--] Data in MyISAM tables: 889 M (Tables: 479)
[--] Data in MEMORY tables: 1 M (Tables: 4)
[!] Total fragmented tables: 29
-------- Security Recommendations -------------------------------------------
[OK] All database users have passwords assigned
-------- Performance Metrics -------------------------------------------------
[--] Up for: 12 h 55 m 27 s (4 M q [105.230 qps], 295 K conn, TX: 9B, RX: 546 M)
[--] Reads/Writes: 82%/18%
[--] Total buffers: 432.0 M global + 6.3 M per thread (500 max threads)
[!] Maximum possible memory usage: 3.5 GB (175% of installed RAM)
[OK] Slow queries: 0% (48 K/4 M)
[OK] Highest usage of available connections: 3% (16/500)
[OK] Key buffer size/total MyISAM indexes: 384.0 M/332.6 M
[OK] Key buffer hit rate: 100.0% (2B cached/205 K reads)
[OK] Query cache efficiency: 49.3% (1 M cached/3 M selects)
[!] Query cache (prunes per day: 268042)
[OK] Sorts requiring temporary tables: 0% (10 temp sorts/122 K sorts)
[OK] Temporary tables created on disk: 19% (4 K on disk/22 K total)
[OK] Thread cache hit rate: 99% (16 created/295 K connections)
[!] Table cache hit rate: 18% (256 open/1 K opened)
[OK] Open file limit used: 19% (497/2 K)
[!] Table locks acquired immediately: 88%
-------- Recommendations -----------------------------------------------------
General recommendations:
Run optimize table to defragment tables for better performance
MySQL started within last 24 hours-recommendations may be inaccurate
Reduce your overall MySQL memory footprint for system stability
Increase table_cache gradually to avoid file descriptor limits
Optimize queries and/or use InnoDB to reduce lock wait
Variables to adjust:
* ** MySQL's maximum memory usage is dangerously high ***
* ** Add RAM before increasing MySQL buffer variables ***
Query_cache_size (> 32 M)
Table_cache (& gt; 256)
BitsCN.com