Lucas Werkmeister
@LucasWerkmeistr
sudo systemctl kill --signal STOP --kill-who all boinc # immediately suspend a service (just make sure it’s not sshd)
11/12/2016, 11:42:06 PM
Favs: 2
Retweets: 1
link← @LucasWerkmeistr Twitter archive
Lucas Werkmeister
@LucasWerkmeistr
sudo systemctl kill --signal STOP --kill-who all boinc # immediately suspend a service (just make sure it’s not sshd)
11/12/2016, 11:42:06 PM
Favs: 2
Retweets: 1
linkLucas Werkmeister
@LucasWerkmeistr
echo 700000 | sudo tee /sys/fs/cgroup/cpu/system.slice/boinc.service/cpu.cfs_quota_us # set a CPU quota
11/12/2016, 11:46:31 PM
Favs: 0
Retweets: 0
linkLucas Werkmeister
@LucasWerkmeistr
# (see cpu.cfs_period_us in the same dir for duration of “period”, setting it to that value means one full CPU, so I set it to 7× that)
11/12/2016, 11:47:15 PM
Favs: 0
Retweets: 0
linkLucas Werkmeister
@LucasWerkmeistr
sudo systemctl kill --signal CONT --kill-who all boinc # and then resume the service again with resources limited :)
11/12/2016, 11:47:34 PM
Favs: 0
Retweets: 0
linkLucas Werkmeister
@LucasWerkmeistr
# (this should be even simpler, with systemctl set-property --runtime CPUQuota=700%, but it doesn’t seem to work for some reason)
11/12/2016, 11:48:02 PM
Favs: 0
Retweets: 0
linkLucas Werkmeister
@LucasWerkmeistr
# oh, and you can track the resource usage of the whole service, including subprocesses, using systemd-cgtop
11/12/2016, 11:48:44 PM
Favs: 0
Retweets: 0
link