2

Is it possible to manage access to CPU cores in a similar fashion that memory limiting works?

In particular I need to be able to dynamically create and destroy cgroups that will limit a particular set of processes to a desired number of CPU cores.

I cannot use CPU sets as this needs to work on multi-socket (upto small NUMA) machines and if I would hard pin processes to cores I would very quickly run into huge performance issues due to core fragmentation (the processes range from minutes to months in runtime).

Second complication is that this needs to play nicely with processes outside of the cgroups.

As an example I can have the following situation:

1 process limited to 2 cores and 4GB RAM

2 processes unlimited, but should have guaranteed access to the remainder of the machine

1 Answer 1

0

These two options can be used to limit number of CPU cores available to a cgroup:

cpu.cfs_period_us cpu.cfs_quota_us 

cfs_period_us defined how often this needs to be enforced cfs_quota_us defines how many us should the cgroup receive during each period. So if you specify cfs_quota_us as N times the amount of cfs_period_us the cgroup will receive N cores.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.