追蹤
NEIL's_學而時習之x不學無術~私藏IT技術經驗分享部落
關於部落格
NEIL. Cheng....寫作只是為了日後工作之備忘操作參考

本部落格文章撰寫前進邁向第五年(since 2009 ~至今)仍繼續推進分享IT學習!!About Windows/Linux Server,Virtualization


分享網誌: 由於,本人預先完成LAB後,才補上撰寫文章與截圖,若發現文圖對照說明有誤..本人將盡快校正,也請不吝指教! Thanks!

  • 159077

    累積人氣

  • 37

    今日人氣

    0

    追蹤人氣

Tune MySQL效能分析工具: MySQL Tuner & MySQL-Tuning-primer by Neil

實驗開始

MySQL version : 5.5.32:


執行測試mysqltuner.pl 測試
 
./mysqltuner.pl 

偵測結果輸出: Part 1: 執行後開始偵測MySQL 相關偵測與修改建議
偵測結果輸出: Part 2: query cache 參數啟用 可以加速DB效能,稍後會建議配置


偵測結果輸出: Part 3: Recommendations: 效能修改診斷建議列表,可供DBA日後參考

                      並修改寫入到/etc/my.cnf 配置檔

                      (本人抓每周DB運行一個區間調校修改配置)


執行測試tuning-primer.sh 測試

./ tuning-primer.sh               #霹靂啪啦偵測後會跑出以下建議與測試報表

    -- MYSQL PERFORMANCE TUNING PRIMER --
             - By: Matthew Montgomery -

MySQL Version 5.5.32 x86_64

Uptime = 0 days 0 hrs 19 min 19 sec
Avg. qps = 0
Total Questions = 42
Threads Connected = 1

Warning: Server has not been running for at least 48hrs.
It may not be safe to use these recommendations

To find out more information on how each of these
runtime variables effects performance visit:
http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html
Visit http://www.mysql.com/products/enterprise/advisors.html
for info about MySQL's Enterprise Monitoring and Advisory Service

SLOW QUERIES
The slow query log is NOT enabled.
Current long_query_time = 10.000000 sec.
You have 0 out of 63 that take longer than 10.000000 sec. to complete
Your long_query_time seems to be fine

BINARY UPDATE LOG
The binary update log is NOT enabled.
You will not be able to do point in time recovery
See http://dev.mysql.com/doc/refman/5.5/en/point-in-time-recovery.html

WORKER THREADS
Current thread_cache_size = 8
Current threads_cached = 0
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine

MAX CONNECTIONS                       #赤字偵測建議配置Max Connections
                                修改較小value值可減少內存記憶體花費
Current max_connections = 151          
Current threads_connected = 1
Historic max_used_connections = 1
The number of used connections is 0% of the configured maximum.
You are using less than 10% of your configured max_connections.
Lowering max_connections could help to avoid an over-allocation of memory
See "MEMORY USAGE" section to make sure you are not over-allocating

INNODB STATUS
Current InnoDB index space = 0 bytes
Current InnoDB data space = 0 bytes
Current InnoDB buffer pool free = 98 %
Current innodb_buffer_pool_size = 128 M
Depending on how much space your innodb indexes take up it may be safe
to increase this value to up to 2 / 3 of total system memory

MEMORY USAGE
Max Memory Ever Allocated : 162 M
Configured Max Per-thread Buffers : 415 M
Configured Max Global Buffers : 160 M
Configured Max Memory Limit : 575 M
Physical Memory : 988 M
Max memory limit seem to be within acceptable norms

KEY BUFFER
No key reads?!
Seriously look into using some indexes
Current MyISAM index space = 106 K
Current key_buffer_size = 8 M
Key cache miss rate is 1 : 0
Key buffer free ratio = 81 %
Your key_buffer_size seems to be fine

QUERY CACHE
Query cache is enabled
Current query_cache_size = 8 M
Current query_cache_used = 16 K
Current query_cache_limit = 4 M
Current Query cache Memory fill ratio = .20 %
Current query_cache_min_res_unit = 4 K
Your query_cache_size seems to be too high.
Perhaps you can use these resources elsewhere
MySQL won't cache query results that are larger than query_cache_limit in size

SORT OPERATIONS
Current sort_buffer_size = 2 M
Current read_rnd_buffer_size = 256 K
Sort buffer seems to be fine

JOINS
Current join_buffer_size = 132.00 K
You have had 0 queries where a join could not use an index properly
Your joins seem to be using indexes properly

OPEN FILES LIMIT
Current open_files_limit = 1024 files
The open_files_limit should typically be set to at least 2x-3x
that of table_cache if you have heavy MyISAM usage.
Your open_files_limit value seems to be fine

TABLE CACHE
Current table_open_cache = 400 tables
Current table_definition_cache = 400 tables
You have a total of 41 tables
You have 41 open tables.
The table_cache value seems to be fine

TEMP TABLES
Current max_heap_table_size = 16 M
Current tmp_table_size = 16 M
Of 266 temp tables, 11% were created on disk
Created disk tmp tables ratio seems fine

TABLE SCANS
Current read_buffer_size = 128 K
Current table scan ratio = 9 : 1
read_buffer_size seems to be fine

TABLE LOCKING
Current Lock Wait ratio = 0 : 321
Your table locking seems to be fine


結論:

這兩支tool對DBA來說調校的確很方便,自動偵測目前DB狀況(衍生現有的瓶頸,最後並列出

修改參數優化DB建議),推薦您試試
 

另外本人最近蒐集整理研究About 網頁設計 支持SEO 關鍵字搜尋最佳化做法與工具

希望得道後開始分享一些SEO與網頁設計應用,另外準備Nginx+GlusterFS測試環境,敬請期待

相簿設定
標籤設定
相簿狀態