我注意到当前离线的服务器上有 15% 的 CPU 负载。它已通过 TCP 挂载 GlusterFS 卷。从顶部看,它向我展示了它的 glusterfs。在那之后,我试图弄清楚到底是什么在使用它,我得到了这个:
# lsof /storage/
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
find 16433 nobody cwd DIR 0,19 8192 9259265867489333824 /storage/200000/200000/200700/200704/08
Run Code Online (Sandbox Code Playgroud)
然后:
# ps uax | grep find
root 16415 0.0 0.0 4400 724 ? SN 06:34 0:00 /bin/sh /usr/bin/updatedb.findutils
root 16423 0.0 0.0 4400 336 ? SN 06:34 0:00 /bin/sh /usr/bin/updatedb.findutils
nobody 16431 0.0 0.0 39524 1376 ? SN 06:34 0:00 su nobody -s /bin/sh -c /usr/bin/find / -ignore_readdir_race \( -fstype NFS -o -fstype nfs -o -fstype nfs4 -o -fstype afs -o -fstype binfmt_misc -o -fstype proc -o -fstype smbfs -o -fstype autofs -o -fstype iso9660 -o -fstype ncpfs -o -fstype coda -o -fstype devpts -o -fstype ftpfs -o -fstype devfs -o -fstype mfs -o -fstype shfs -o -fstype sysfs -o -fstype cifs -o -fstype lustre_lite -o -fstype tmpfs -o -fstype usbfs -o -fstype udf -o -fstype ocfs2 -o -type d -regex '\(^/tmp$\)\|\(^/usr/tmp$\)\|\(^/var/tmp$\)\|\(^/afs$\)\|\(^/amd$\)\|\(^/alex$\)\|\(^/var/spool$\)\|\(^/sfs$\)\|\(^/media$\)\|\(^/var/lib/schroot/mount$\)' \) -prune -o -print0
nobody 16432 0.0 0.0 4400 616 ? SN 06:34 0:00 sh -c /usr/bin/find / -ignore_readdir_race \( -fstype NFS -o -fstype nfs -o -fstype nfs4 -o -fstype afs -o -fstype binfmt_misc -o -fstype proc -o -fstype smbfs -o -fstype autofs -o -fstype iso9660 -o -fstype ncpfs -o -fstype coda -o -fstype devpts -o -fstype ftpfs -o -fstype devfs -o -fstype mfs -o -fstype shfs -o -fstype sysfs -o -fstype cifs -o -fstype lustre_lite -o -fstype tmpfs -o -fstype usbfs -o -fstype udf -o -fstype ocfs2 -o -type d -regex '\(^/tmp$\)\|\(^/usr/tmp$\)\|\(^/var/tmp$\)\|\(^/afs$\)\|\(^/amd$\)\|\(^/alex$\)\|\(^/var/spool$\)\|\(^/sfs$\)\|\(^/media$\)\|\(^/var/lib/schroot/mount$\)' \) -prune -o -print0
nobody 16433 0.3 0.0 13612 1532 ? SN 06:34 0:38 /usr/bin/find / -ignore_readdir_race ( -fstype NFS -o -fstype nfs -o -fstype nfs4 -o -fstype afs -o -fstype binfmt_misc -o -fstype proc -o -fstype smbfs -o -fstype autofs -o -fstype iso9660 -o -fstype ncpfs -o -fstype coda -o -fstype devpts -o -fstype ftpfs -o -fstype devfs -o -fstype mfs -o -fstype shfs -o -fstype sysfs -o -fstype cifs -o -fstype lustre_lite -o -fstype tmpfs -o -fstype usbfs -o -fstype udf -o -fstype ocfs2 -o -type d -regex \(^/tmp$\)\|\(^/usr/tmp$\)\|\(^/var/tmp$\)\|\(^/afs$\)\|\(^/amd$\)\|\(^/alex$\)\|\(^/var/spool$\)\|\(^/sfs$\)\|\(^/media$\)\|\(^/var/lib/schroot/mount$\) ) -prune -o -print0
Run Code Online (Sandbox Code Playgroud)
我杀死了 16432 和 16433,CPU 现在又是 %0。
有人可以告诉我有关这些丑陋的 find 命令的任何信息吗?是否可能是其他服务器也安装了此 /storage 的原因?
根据监测,它每天都在同一时间发生。
use*_*517 12
看起来它是每日updatedb作业的一部分,该作业运行以更新locate命令使用的数据库 。
您可能会在/etc/cron.daily
asmlocate
或 similar 中找到它。
如果您使用,ps -ef
您将获得可用于回溯的 PID(进程)和 PPID(父 PID)。您可能已经看到您杀死的进程的 PPID 为 16415、16423。
像pstree这样的工具对于这种事情也很方便。
pstree -p -H5295
Run Code Online (Sandbox Code Playgroud)
给出这样的输出
|-sshd(5291)---sshd(5294)---bash(5295)-+-more(6098)
| `-pstree(6097)
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2476 次 |
最近记录: |