Some questions regarding CPU resource limits

(Saul Costa) #1

Hello, happy new year!

I have some questions about CPU resource constraints.

First, is there a way to limit a container to N CPUs from a given range? E.g. 2 CPUs from CPUs 2 through 7. The reason I’d like to do this is to ensure that certain CPUs are left idle for use by the LXD daemon itself.

Also, is it possible to impose two types of CPU limits, e.g. 25% AND 200ms/100ms, applied via two different profiles? Meaning use 25% of what is available, up to 2 CPUs worth?

Thank you!


Isn’t that what your are looking for ?

(Saul Costa) #3

No, that post explains how to assign CPUs in a range OR a number of CPUs, but I’d like to do both (e.g. 2 CPUs out of the range of CPUs 2 through 7).

It also only explains how to use one type of limit (either time slices or % of available), while I’d like to apply both (e.g. 25% of what is available, up to 2 CPUs worth).


It is more than a “post”: it is the official documentation. So what you are asking for is either undocumented, which I doubt it is, or not possible…

(Saul Costa) #5

@stgraber or other maintainers, could you please confirm that what I’m trying to do isn’t possible?

(Stéphane Graber) #6

It isn’t.

(Saul Costa) #7

Okay, thanks.