vpsadminos-image-build-scripts
vpsadminos-image-build-scripts copied to clipboard
Override clamav-freshclam.service and set cpu quota
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