linux – 服务器上的奇怪进程消耗CPU

linux – 服务器上的奇怪进程消耗CPU,第1张

概述我注意到服务器上15%的CPU负载当前处于脱机状态.它已通过TCP挂载GlusterFS卷.从顶部看,它向我展示了它的glusterfs.之后,我试图弄清楚究竟是什么使用它,我得到了这个: # lsof /storage/COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMEfind 16433 我注意到服务器上15%的cpu负载当前处于脱机状态.它已通过TCP挂载glusterFS卷.从顶部看,它向我展示了它的glusterfs.之后,我试图弄清楚究竟是什么使用它,我得到了这个:
# lsof /storage/COMMAND   PID   USER   FD   TYPE DEVICE SIZE/OFF                NODE namefind    16433 nobody  cwd    DIR   0,19     8192 9259265867489333824 /storage/200000/200000/200700/200704/08

然后:

# ps uax | grep findroot     16415  0.0  0.0   4400   724 ?        SN   06:34   0:00 /bin/sh /usr/bin/updatedb.findutilsroot     16423  0.0  0.0   4400   336 ?        SN   06:34   0:00 /bin/sh /usr/bin/updatedb.findutilsnobody   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 -print0nobody   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 -print0nobody   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

我杀了16432和16433,cpu现在又是%0.

有人可以告诉我这些丑陋的发现命令吗?是否有可能是由于其他服务器也安装了这个/存储器?

根据监测,它每天都在同一时间发生.

解决方法 看起来它是每日 updatedb作业的一部分,用于更新 locate命令使用的数据库.

你可能会在/etc/cron.daily中找到它作为mlocate或类似的东西.

如果使用ps -ef,则会获得可用于追溯的PID(进程)和PPID(父PID).你可能会看到你杀死的进程有PPID 16415,16423.

像pstree这样的工具对于这种事情也很方便.

pstree -p -H5295

给出这样的输出

|-sshd(5291)---sshd(5294)---bash(5295)-+-more(6098)  |                                      `-pstree(6097)
总结

以上是内存溢出为你收集整理的linux – 服务器上的奇怪进程消耗CPU全部内容,希望文章能够帮你解决linux – 服务器上的奇怪进程消耗CPU所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/1038842.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存