mysqltuner.pl
是mysql一個常用的資料庫性能診斷工具,主要檢查引數設定的合理性包括日志檔案、存盤引擎、安全建議及性能分析,針對潛在的問題,給出改進的建議,是mysql優化的好幫手,
下載:
wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl
使用
[root@localhost ~]# ./mysqltuner.pl --socket /var/lib/mysql/mysql.sock
>> MySQLTuner 1.7.4 - Major Hayden <major@mhtx.net>
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering
[--] Skipped version check for MySQLTuner script
Please enter your MySQL administrative login: root
Please enter your MySQL administrative password: [OK] Currently running supported MySQL version 5.7.23
[OK] Operating on 64-bit architecture
報告分析
1)重要關注 [!!](中括號有嘆號的項)例如 [!!] Maximum possible memory usage: 4.8G (244.13% of installed RAM),表示記憶體已經嚴重用超了,
2)關注最后給的建議“Recommendations ”,
tuning-primer.sh
mysql的另一個優化工具,針于mysql的整體進行一個體檢,對潛在的問題,給出優化的建議,
目前,支持檢測和優化建議的內容如下:

下載
[root@localhost ~]#wget https://launchpad.net/mysql-tuning-primer/trunk/1.6-r1/+download/tuning-primer.sh
使用
[root@localhost ~]# [root@localhost dba]# ./tuning-primer.sh
-- MYSQL PERFORMANCE TUNING PRIMER --
- By: Matthew Montgomery -
報告分析
重點查看有紅色告警的選項,根據建議結合自己系統的實際情況進行修改,例如:

掌握一個就可以了,
僅此記錄,以防遺忘,
FROM: https://mp.weixin.qq.com/s/ppPYwUNATMcudsxrV3yKpA
END
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/295381.html
標籤:其他
上一篇:pytest-json資料驅動
