程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> MYSQL數據庫 >> 關於MYSQL數據庫 >> mysql性能優化腳本mysqltuner.pl

mysql性能優化腳本mysqltuner.pl

編輯:關於MYSQL數據庫

無意中發現了,major哥們開發的一個性能分析腳本,很有意思,可以通過這個腳本學學他的思想。

官方站點:http://blog.MySQLtuner.com/get-involved/

wget http://mysqltuner.pl/MySQLtuner.pl

[root@server63 ~]# perl mysqltuner.pl --socket=/tmp/MySQL.sock

>> MySQLTuner 1.0.1 - Major Hayden <[email protected]>
>> Bug reports, feature requests, and downloads at http://MySQLtuner.com/
>> Run with '--help' for additional options and output filtering
[!!] Successfully authenticated with no passWord - SECURITY RISK!

-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.0.86-log
[OK] Operating on 64-bit architecture

-------- Storage Engine Statistics -------------------------------------------
[--] Status: -Archive -BDB -Federated -InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 3G (Tables: 255)
[--] Data in MEMORY tables: 2M (Tables: 2)
[!!] Total fragmented tables: 39

-------- Performance Metrics -------------------------------------------------
[--] Up for: 15d 16h 8m 16s (338M q [249.647 qps], 25M conn, TX: 1026B, RX: 36B)
[--] Reads / Writes: 84% / 16%
[--] Total buffers: 1.1G global + 12.4M per thread (3000 max threads)
[!!] Maximum possible memory usage: 37.4G (479% of installed RAM)
[OK] Slow querIEs: 0% (194/338M)
[OK] Highest usage of available connections: 25% (760/3000)
[OK] Key buffer size / total MyISAM indexes: 1.0G/623.0M
[OK] Key buffer hit rate: 100.0% (15B cached / 3M reads)
[OK] Query cache efficIEncy: 45.0% (96M cached / 214M selects)
[!!] Query cache prunes per day: 585977
[OK] Sorts requiring temporary tables: 0% (68K temp sorts / 17M sorts)
[!!] Joins performed without indexes: 28072
[OK] Temporary tables created on disk: 0% (8K on disk / 5M total)
[OK] Thread cache hit rate: 99% (187K created / 25M connections)
[!!] Table cache hit rate: 1% (512 open / 44K opened)
[OK] Open file limit used: 5% (772/15K)
[OK] Table locks acquired immediately: 99% (180M immediate / 181M locks)

-------- Recommendations -----------------------------------------------------
General recommendations:
    Run OPTIMIZE TABLE to defragment tables for better performance
    Reduce your overall MySQL memory footprint for system stability
    Enable the slow query log to troubleshoot bad querIEs
    Adjust your join querIEs to always utilize indexes
    Increase table_cache gradually to avoid file descriptor limits
Variables to adjust:
*** MySQL's maximum memory usage is dangerously high ***
*** Add RAM before increasing MySQL buffer variables ***
    query_cache_size (> 128M)
    join_buffer_size (> 128.0K, or always use indexes with joins)
    table_cache (> 512)

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved