vpsadminos-image-build-scripts icon indicating copy to clipboard operation
vpsadminos-image-build-scripts copied to clipboard

Override clamav-freshclam.service and set cpu quota

Open aither64 opened this issue 5 years ago • 0 comments

freshclam processes from multiple VPS tend to go crazy all at once, overloading the nodes. We can't really help it if people install it, but we could add override to all templates using systemd and limit the CPU usage, e.g.:

mkdir -p /etc/systemd/system/clamav-freshclam.service.d
cat <<EOF > /etc/systemd/system/clamav-freshclam.service.d/override.conf
[Service]
CPUQuota=25%
CPUWeight=10
EOF

aither64 avatar Apr 05 '19 17:04 aither64