[Lxc-users] how to use cpuset.shares?

Robert Kawecki thewanderer at gim11.pl
Thu Aug 25 20:55:09 UTC 2011


Hi,

>From your original post, I conclude that you're after functionality akin
to that of OpenVZ's cpulimit, that is, limiting the absolute amount of
processing power (giving your container, for example, 1GHz out of a 2GHz
processor core).

LXC cpu.shares does not provide this kind of functionality - it is only
used by the scheduler to assign resources proportionally. That is, if
you only have 1 container running with 2 CPUs assigned, and cpu.shares
is set to half, or quarter of the maximum, the container can still use 2
CPUs to their fullest if the machine is otherwise idle.

If you're coming from an OpenVZ background, an easy comparison is that
cpu.shares is functionally equivalent to cpuunits in OpenVZ.
As far as I know, LXC doesn't implement CPU limiting (throttling)
feature (neither do current OpenVZ releases; apparently it's hard to
maintain).





More information about the lxc-users mailing list