Set resource limits at runtime

Apply cgroup limits now without a restart; --runtime makes them temporary, so they are gone after reboot

systemctl set-property --runtime <unit> MemoryMax=512M CPUQuota=50%

tool
systemd26 commands
tags
systemdperformancetroubleshooting

More systemd commands

  • systemctl list-jobs

    Show running start/stop jobs to debug a hung boot or a unit stuck in activating

  • systemctl enable --now myapp.service

    Turn on start at boot and start the service now with one command

  • systemctl list-units --state=failed

    List all units in the failed state

  • systemctl daemon-reload && systemctl restart myapp.service

    Reload unit files and restart the service

  • systemctl edit myapp.service

    Open /etc/systemd/system/myapp.service.d/override.conf in an editor for partial overrides

all 26 systemd commands