Page 1 of 1

limiting cpu consomption with systemd ?

Posted: Sun Mar 10, 2024 9:26 am
by promeneur
With Linux, I use "cpulimit" to limit CPU consumption of the cores.

I know these days there is something more modern using systemd, but it is too techie.

Please, can you (folding team) provide this systemd alternative ?

Thanks

Re: limiting cpu consomption with systemd ?

Posted: Sun Mar 10, 2024 3:36 pm
by Marcos FRM
https://www.freedesktop.org/software/sy ... %20Control

CPUQuota=XX (in percent) should work ([Service] section) with distributions running unified cgroup hierarchy (check "default-hierarchy=" in "systemctl --version" output), but note that it is relative to one CPU. The value has to be multiplied by CPU count used for folding.

You can also try

https://github.com/FoldingAtHome/fah-cl ... nt-8578995

For testing purposes, calling

Code: Select all

sudo chrt -b -p 0 $(pgrep -x FahCore_a8)
has the same effect as the linked patch. To reset to default SCHED_OTHER:

Code: Select all

sudo chrt -o -p 0 $(pgrep -x FahCore_a8)
(adapt the core name if necessary)

Code: Select all

ps -o nice,class,comm -p $(pgrep -x FahCore_a8)
will show ("CLS" column) current policy: B = SCHED_BATCH, TS = SCHED_OTHER.

Re: limiting cpu consomption with systemd ?

Posted: Mon Mar 11, 2024 8:53 am
by promeneur
Thanks