Discussion:
[systemd-devel] Is it possible to set CPUAffinity at runtime
Cecil Westerhof
2018-01-21 20:16:01 UTC
Permalink
I would like to change the CPUaffinity of a service at runtime. Is this
possible?
​If it is not possible with a systemd command, it can be done like this:
taskset -cp 3 21234​

​This set the CPUAffinity of process with pid 21234 to cpu3.​
--
Cecil Westerhof
Lennart Poettering
2018-01-22 12:45:52 UTC
Permalink
I would like to change the CPUaffinity of a service at runtime. Is this
possible?
systemd does not expose this currently, even though we'd love to. This
depends on the cpuset cgroup controller in the kernel becoming usable
however, it currently is really broken conceptually on cgroupsv1, and
on cgroupsv2 currently doesn't exist at all...

So yeah, "taskset" is the only way right now.

Lennart
--
Lennart Poettering, Red Hat
Loading...