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%左右;