MySQLTuner 下载地址:http://github.com/rackerhacker/MySQLTuner-perl

MySQLTuner 使用方法:
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

看看我的运行结果

 

 
  
  1. >> MySQLTuner 1.1.1 - Major Hayden   
  2. >> Bug reports, feature requests, and downloads at http://mysqltuner.com/   
  3. >> Run with '--help' for additional options and output filtering  
  4.  
  5. -------- General Statistics --------------------------------------------------   
  6. [--] Skipped version check for MySQLTuner script   
  7. [OK] Currently running supported MySQL version 5.1.43-log   
  8. [OK] Operating on 64-bit architecture  
  9.  
  10. -------- Storage Engine Statistics -------------------------------------------   
  11. [--] Status: -Archive -BDB -Federated -InnoDB -ISAM -NDBCluster   
  12. [--] Data in MyISAM tables: 889M (Tables: 479)   
  13. [--] Data in MEMORY tables: 1M (Tables: 4)   
  14. [!!] Total fragmented tables: 29  
  15.  
  16. -------- Security Recommendations -------------------------------------------   
  17. [OK] All database users have passwords assigned  
  18.  
  19. -------- Performance Metrics -------------------------------------------------   
  20. [--] Up for: 12h 55m 27s (4M q [105.230 qps], 295K conn, TX: 9B, RX: 546M)   
  21. [--] Reads / Writes: 82% / 18%   
  22. [--] Total buffers: 432.0M global + 6.3M per thread (500 max threads)   
  23. [!!] Maximum possible memory usage: 3.5G (175% of installed RAM)   
  24. [OK] Slow queries: 0% (48K/4M)   
  25. [OK] Highest usage of available connections: 3% (16/500)   
  26. [OK] Key buffer size / total MyISAM indexes: 384.0M/332.6M   
  27. [OK] Key buffer hit rate: 100.0% (2B cached / 205K reads)   
  28. [OK] Query cache efficiency: 49.3% (1M cached / 3M selects)   
  29. [!!] Query cache prunes per day: 268042   
  30. [OK] Sorts requiring temporary tables: 0% (10 temp sorts / 122K sorts)   
  31. [OK] Temporary tables created on disk: 19% (4K on disk / 22K total)   
  32. [OK] Thread cache hit rate: 99% (16 created / 295K connections)   
  33. [!!] Table cache hit rate: 18% (256 open / 1K opened)   
  34. [OK] Open file limit used: 19% (497/2K)   
  35. [!!] Table locks acquired immediately: 88%  
  36.  
  37. -------- Recommendations -----------------------------------------------------   
  38. General recommendations:   
  39. Run OPTIMIZE TABLE to defragment tables for better performance   
  40. MySQL started within last 24 hours - recommendations may be inaccurate   
  41. Reduce your overall MySQL memory footprint for system stability   
  42. Increase table_cache gradually to avoid file descriptor limits   
  43. Optimize queries and/or use InnoDB to reduce lock wait   
  44. Variables to adjust:   
  45. *** MySQL's maximum memory usage is dangerously high ***   
  46. *** Add RAM before increasing MySQL buffer variables ***   
  47. query_cache_size (> 32M)   
  48. table_cache (> 256)