Mysql 之 性能分析(mysqlreport工具)
阿新 • • 發佈:2018-08-24
lin admin multi tar localhost per 必須 數據 log 一、mysqlreport 作用
進行MySQL的配置優化,首先必須找出MySQL的性能瓶頸所在;而SHOW STATUS輸出的報告正是用來計算性能瓶頸的參考數據。mysqlreport不像SHOW STATUS那樣簡單的羅列數據,而是對這些參考數據加以融合計算,整理成一個個優化參考點,然後就可以根據這個優化參考點的值以及該點的衡量標準,進行對應調整。
一、mysqlreport 安裝
[root@localhost ~]# yum -y install perl-DBD-MySQL #依賴包 [root@localhost ~]# yum -y install perl-DBI #依賴包 [root@localhost ~]#wget http://pkgs.fedoraproject.org/repo/pkgs/mysqlreport/mysqlreport-3.5.tgz/33a345f5e2c89b083a9ff0423f7fd7b4/mysqlreport-3.5.tgz [root@localhost ~]#tar -zxf mysqlreport-3.5.tgz [root@localhost mysqlreport-3.5]# ll 總用量 144 -rw-r--r-- 1 121813 18980 35147 4月 16 2008 COPYING -rwxr-xr-x 1 121813 18980 38873 4月 16 2008 mysqlreport #分析報告工具 -rw-r--r-- 1 121813 18980 12538 4月 16 2008 mysqlreportdoc.html -rw-r--r-- 1 121813 18980 52932 4月 16 2008 mysqlreportguide.html
一、mysqlreport 使用
[root@localhost mysqlreport-3.5]# ./mysqlreport --user test --password xxxxx --host 10.3.151.185 --socket /tmp/mysqld.sock Use of uninitialized value in formline at ./mysqlreport line 1099. Use of uninitialized value $is in multiplication (*) at ./mysqlreport line 829. Use of uninitialized value in formline at ./mysqlreport line 1227. Use of uninitialized value in formline at ./mysqlreport line 1235. MySQL 5.6.37-log uptime 8 22:42:13 Thu Aug 23 21:57:27 2018 __ Key _________________________________________________________________ Buffer used 424.00k of 8.00M %Used: 5.18 Current 1.46M %Usage: 18.24 Write hit 100.00% Read hit 100.00% __ Questions ___________________________________________________________ Total 1.82M 2.4/s Com_ 1.43M 1.9/s %Total: 78.94 DMS 1.01M 1.3/s 55.75 -Unknown 644.84k 0.8/s 35.49 COM_QUIT 14.44k 0.0/s 0.79 Slow 100 ms 46.73k 0.1/s 2.57 %DMS: 4.61 Log: DMS 1.01M 1.3/s 55.75 SELECT 971.21k 1.3/s 53.45 95.87 INSERT 24.23k 0.0/s 1.33 2.39 UPDATE 17.20k 0.0/s 0.95 1.70 DELETE 388 0.0/s 0.02 0.04 REPLACE 0 0/s 0.00 0.00 Com_ 1.43M 1.9/s 78.94 admin_comma 631.92k 0.8/s 34.78 set_option 529.08k 0.7/s 29.12 commit 256.63k 0.3/s 14.12 __ SELECT and Sort _____________________________________________________ Scan 825.18k 1.1/s %SELECT: 84.96 Range 3 0.0/s 0.00 Full join 538.09k 0.7/s 55.40 Range check 0 0/s 0.00 Full rng join 0 0/s 0.00 Sort scan 1.87M 2.4/s Sort range 3.29k 0.0/s Sort mrg pass 0 0/s __ Query Cache _________________________________________________________ Memory usage 16.81k of 1.00M %Used: 1.64 Block Fragmnt 100.00% Hits 0 0/s Inserts 1 0.0/s Insrt:Prune 1:1 0/s Hit:Insert 0.00:1 __ Table Locks _________________________________________________________ Waited 0 0/s %Total: 0.00 Immediate 1.63M 2.1/s __ Tables ______________________________________________________________ Open 135 of 2000 %Cache: 6.75 Opened 521 0.0/s __ Connections _________________________________________________________ Max used 37 of 2000 %Max: 1.85 Total 14.53k 0.0/s __ Created Temp ________________________________________________________ Disk table 45.90k 0.1/s Table 1.67M 2.2/s Size: 512.0M File 26 0.0/s __ Threads _____________________________________________________________ Running 3 of 9 Cached 24 of 28 %Hit: 99.74 Created 38 0.0/s Slow 0 0/s __ Aborted _____________________________________________________________ Clients 187 0.0/s Connects 12.89k 0.0/s __ Bytes _______________________________________________________________ Sent 5.83G 7.5k/s Received 370.77M 479.7/s __ InnoDB Buffer Pool __________________________________________________ Usage 73.45M of 7.86G %Used: 0.91 Read hit 100.00% Pages Free 510.36k %Total: 99.09 Data 4.66k 0.91 %Drty: 0.00 Misc 37 0.01 Latched 0.00 Reads 1.20G 1.6k/s From file 1.22k 0.0/s 0.00 Ahead Rnd 0 0/s Ahead Sql 0/s Writes 290.67k 0.4/s Flushes 99.48k 0.1/s Wait Free 0 0/s __ InnoDB Lock _________________________________________________________ Waits 4 0.0/s Current 0 Time acquiring Total 9 ms Average 2 ms Max 3 ms __ InnoDB Data, Pages, Rows ____________________________________________ Data Reads 1.33k 0.0/s Writes 205.19k 0.3/s fsync 182.03k 0.2/s Pending Reads 0 Writes 0 fsync 0 Pages Created 1.53k 0.0/s Read 3.13k 0.0/s Written 99.48k 0.1/s Rows Deleted 1.04k 0.0/s Inserted 25.13k 0.0/s Read 7.65G 9.9k/s Updated 18.03k 0.0/s
Mysql 之 性能分析(mysqlreport工具)