mysql slave运行慢_Linux-strace-分析MySQL数据库slaveSQL进程运行缓慢

本文介绍了如何使用strace工具分析MySQL Slave SQL进程运行缓慢的问题。通过在Centos7.3上安装和使用strace,跟踪系统调用,找出可能导致延迟的原因。内容包括strace的下载、安装、编译和使用,以及针对MySQL Slave的监控实例。
摘要由CSDN通过智能技术生成

MySQL Slave lag很高,而且越来越高,表面现象slave

sql进程运行缓慢,从MySQL技术角度已经找到问题点,再次使用strace验证。

strace 命令是一种强大的工具, 能够显示任何由用户空间程式发出的系统调用. strace 显示这些调用的参数并返回符号形式的值. strace 从内核接收信息, 而且无需以任何特别的方式来构建内核. strace 的每一行输出包括系统调用名称, 然后是参数和返回值.

以下在Centos7.3上安装strace过程。

下载地址:https://sourceforge.net/projects/strace/files/strace/

[root@f08-kk-mysql02 dba]# pwd

/home/dba

[root@f08-kk-mysql02 dba]# ls -l

total 10980

-rw-rw-r-- 1 dba dba 0 Aug 5 16:27 1.txt

-rw-rw-r-- 1 dba dba 5204 May

31 19:19 autoquery.sql

-rw-r----- 1 dba dba 722897

Aug 5 10:25 mysqldb02-slow.log

-rw-rw-r-- 1 dba dba 8910888 Aug 6 11:24

perf-3.10.0-957.el7.x86_64.rpm

-rw-r--r-- 1 root root 1976 May 31 23:25 query.sql

drwxr-xr-x 13 root root 12288 Aug 6 12:28

strace-4.21

-rw-rw-r-- 1 root root 1185908

Aug 6 11:38 strace-4.21.tar.xz

-rw-rw-r-- 1 root root 372920 May 31 16:14 zabbix-agent-3.4.9-1.el7.x86_64.rpm

-rw-rw-r-- 1 root root 10604 May 31 16:14 zabbix_agentd.conf

[root@f08-kk-mysql02 dba]# tar -xvpf strace-4.21.tar.xz

.......

[root@f08-kk-mysql02 dba]# cd strace*

[root@f08-kk-mysql02 strace-4.21]# pwd

/home/dba/strace-4.21

[root@f08-kk-mysql02 strace-4.21]# ./configure

.......

checking for m32 personality compile support... yes

checking for m32 personality runtime support... no

checking whether mpers.sh m32 -m32 works... yes

checking for struct stat... yes

checking for struct stat.st_mtime_nsec... yes

checking for struct stat64... yes

checking for struct stat64.st_mtime_nsec... yes

checking whether to enable m32 personality support...

yes

checking gnu/stubs-x32.h usability... no

checking gnu/stubs-x32.h presence... no

checking for gnu/stubs-x32.h... no

configure: Created empty gnu/stubs-x32.h

checking for mx32 personality compile support... yes

checking for mx32 personality runtime support... no

checking whether mpers.sh mx32 -mx32 works... yes

checking for struct stat... yes

checking for struct stat.st_mtime_nsec... yes

checking for struct stat64... no

checking for struct stat64.st_mtime_nsec... no

checking whether to enable mx32 personality support...

yes

checking for valgrind... no

<
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值