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
<