码迷,mamicode.com
首页 > 数据库 > 详细

Mysql 之 性能分析(mysqlreport工具)

时间:2018-08-23 23:06:55      阅读:289      评论:0      收藏:0      [点我收藏+]

标签:cts   2.3   set   衡量标准   .so   sock   known   host   http   

一、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工具)

标签:cts   2.3   set   衡量标准   .so   sock   known   host   http   

原文地址:http://blog.51cto.com/12965094/2163596

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!