Skip to main content

NB Systemd nspawn Resource Control

# make permanent changes, limit memory to one gig and CPU usage to two cores
# add --runtime opt to make temporary changes w/o reboot
sudo systemctl set-property systemd-nspawn@vms-cloudlog-arch-ext.service CPUQuota=200%
sudo systemctl set-property systemd-nspawn@vms-cloudlog-arch-ext.service MemoryMax=1073741824
sudo systemctl restart systemd-nspawn@vms-cloudlog-arch-ext.service

Check results:

systemd-cgtop machine.slice/systemd-nspawn@vms-cloudlog-arch-ext.service