maldet --scan-all / 查杀时clamscan 进程CPU占用高处理,cpulimit的使用

maldetect 介绍文档 https://github.com/waja/maldetect/blob/master/README

修改 maldetect 的配置文件 /usr/local/maldetect/conf.maldet ,如下:

# Set hard limit on CPU usage for find and clam(d)scan processes. This
# requires the 'cpulimit' binary to be available on the server. The values
# are expressed as relative percentage * N cores on system. An 8 CPU core
# server would accept values from 0 - 800, 12 cores 0 - 1200 etc...
scan_cpulimit="20"  # 限制扫描CPU使用率,生效的前提是安装 cpulimit工具

根据个人需求设置 scan_cpulimit的值。

需要安装工具cpulimit:

#使用root运行命令:

#debian/ubuntu系统
#apt install -y cpulimit

#RHEL/Centos/Fedora系统
#yum install -y epel-release cpulimit
yum install -y cpulimit


# 常规用法
#限制firefox使用30% cpu利用率
#cpulimit -e firefox -l 30

#限制进程号1313的程序使用30%cpu利用率
#cpulimit -p 1313 -l 30

#限制绝对路径下该软件的cpu利用率
#cpulimit -e /usr/local/nginx/sbin/nginx -l 50

再次执行 maldet --scan-all /

CPU使用率在 20%左右;

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值