Use systemd resource limits
sudo systemctl edit clamd@scan.serviceEdit value
[Service]
CPUQuota=50%
Nice=10
IOSchedulingClass=2
IOSchedulingPriority=7Reload systemd and restart the service:
sudo systemctl daemon-reload
sudo systemctl restart clamd@scan.service