博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
mysql工具innotop安装
阅读量:7030 次
发布时间:2019-06-28

本文共 2793 字,大约阅读时间需要 9 分钟。

INNOTOP是一个通过文本模式显示MySQL和 InnoDB的监测工具。它有很多特点,快速的配置的,易于使用等。它吸取了MYTOP的精华这使它变得更加强大。INNOTOP是用PERL语言写成 的,这是它能更加灵活的使用在各种操作平台之上,它能详细的的监控出当前MYSQL和INNODB运行的状态,以便维护人员根据结果合理的优化 MYSQL,让MYSQL更稳定更高效的运行。

安装INNOTOP工具非常的简单,既然是由PERL写的,当然需要PERL环境和相关的工具包。

 

1、下载innotop的源码包,可以从

http://internap.dl.sourceforge.net/sourceforge/innotop 下载 源码包,下载之后可以解压

tar-zxvf innotop-1.8.0\ \(1\).tar.gz

cd innotop-1.8.0 进入目录之后可以查看文件,可以查看 INSTALL 文件查看安装步骤。

perl Makefile.PL

如果innotop 需要的perl 模块没有安装全就会报错,然后通过

cpan -i modulename 安装需要模块之后,重新执行perl Makefile.PL

如果没有报错 然后 使用make install 安装 innotop。

安装之后系统就会多出一个命令,innotop

#innotop  –help 就会看到

[root@test innotop-1.8.0]# innotop  –help

Usage: innotop <options> <innodb-status-file>

–[no]color   -C   Use terminal coloring (default)

–config      -c   Config file to read
–count            Number of updates before exiting
–delay       -d   Delay between updates in seconds
–help             Show this help message
–host        -h   Connect to host
–[no]inc     -i   Measure incremental differences
–mode        -m   Operating mode to start in
–nonint      -n   Non-interactive, output tab-separated fields
–password    -p   Password to use for connection
–port        -P   Port number to use for connection
–skipcentral -s   Skip reading the central configuration file
–socket      -S   MySQL socket to use for connection
–timestamp   -t   Print timestamp in -n mode (1: per iter; 2: per line)
–user        -u   User for login if not current user
–version          Output version information and exit
–write       -w   Write running configuration into home directory if no config files were loaded

加上需要的参数就可以监控mysql 。

如# innotop  -uuser -ppassword  -S sock路径

就会看到

[RO] Query List (? for help)                                localhost, 3+22:33:35.004, 0.74 QPS, 3/1/19 con/run/cac thds, 5.1.50-log

When   Load  QPS   Slow  Se/In/Up/De%  QCacheHit  KCacheHit  BpsIn  BpsOut

Total  0.00  0.74     0  58/ 0/14/ 0      57.71%     99.75%  45.60  454.74

Cmd    ID      State  User   Host           DB      Time   Query

然后输入? 帮助

Switch to a different mode:

B  InnoDB Buffers    L  Locks               R  InnoDB Row Ops
C  Command Summary   M  Replication Status  S  Variables & Status
D  InnoDB Deadlocks  O  Open Tables         T  InnoDB Txns
F  InnoDB FK Err     Q  Query List          U  User Statistics
I  InnoDB I/O Info

Actions:

a  Toggle the innotop process    k  Kill a query’s connection
c  Choose visible columns        n  Switch to the next connection
d  Change refresh interval       p  Pause innotop
e  Explain a thread’s query      q  Quit innotop
f  Show a thread’s full query    r  Reverse sort order
h  Toggle the header on and off  s  Change the display’s sort column
i  Toggle idle processes         x  Kill a query

Other:

TAB  Switch to the next server group   /  Quickly filter what you see
!  Show license and warranty         =  Toggle aggregation
#  Select/create server groups       @  Select/create server connections
$  Edit configuration settings       \  Clear quick-filters
Press any key to continue

根据上面的提示查看mysql 的各种状态。希望你能找到影响性能的瓶颈。

本文转自 fenghao.cn 51CTO博客,原文链接:http://blog.51cto.com/linuxguest/721185,如需转载请自行联系原作者
你可能感兴趣的文章
3·15曝光丨智能机器人一年拨打40亿个骚扰电话,6亿人信息已遭泄露!
查看>>
腾讯携手中科院国家天文台落地FAST 用云计算探索星辰大海
查看>>
随机森林算法4种实现方法对比测试:DolphinDB速度最快,XGBoost表现最差
查看>>
详解前端异步编程的六种方案
查看>>
红帽论坛北京站召开 设立亚太开放创新实验室
查看>>
苏宁11.11:如何基于异步化打造会员任务平台?
查看>>
区块链和数据科学:如果同时应用这两种技术,将会实现什么?
查看>>
Oracle即将发布的全新Java垃圾收集器 ZGC
查看>>
深入浅出Tensorflow(三):训练神经网络模型的常用方法
查看>>
Blazor将.NET带回到浏览器
查看>>
利用人工智能提升团队包容性
查看>>
详解分布式系统本质:“分治”和“冗余”
查看>>
gRPC-Web发布,REST又要被干掉了?
查看>>
全站爬虫项目一阶段总结
查看>>
在项目中引入领域驱动设计的经验
查看>>
用关系型NoSQL回到未来
查看>>
Jeff Bean谈Flink与流式处理的5大新发现
查看>>
技术寡头争霸传之:控制开源工具,就控制了整个生态
查看>>
微软把UWP定位成业务线应用程序开发平台
查看>>
2018腾讯云+未来峰会互联网专场:腾讯云智能物联解决方案亮相
查看>>