[Lxc-users] CPU and Memory Quota for LXC

Daniel Lezcano daniel.lezcano at free.fr
Sat Jul 10 11:33:08 UTC 2010


On 07/09/2010 05:57 AM, Abi Wilson wrote:

> Hi,
>    

Hi Abi,

actually the quota is working well but the /proc information is not 
virtualized, so you will see the memory available on your host, not the 
memory you set with the cgroup.

> I tried to allocate quota(CPU and Memory)  for each containers , for that I
> have tried with the below lxc-config file . With this config I am able to
> create container and able to start the container, But the RAM memory
> displayed is same as Host. Do I need to modify anything to get Quota
> working? Will Lxc support Quota management ? I am using 2.6.29 kernel with
> the following config for lxc and using lxc-0.6.5.
>
> CONFIG_CGROUPS=y
> CONFIG_CGROUP_DEBUG=y
> CONFIG_CGROUP_NS=y
> CONFIG_CGROUP_FREEZER=y
> CONFIG_CGROUP_DEVICE=y
> CONFIG_CPUSETS=y
> CONFIG_PROC_PID_CPUSET=y
> CONFIG_CGROUP_CPUACCT=y
> CONFIG_RESOURCE_COUNTERS=y
> CONFIG_CGROUP_MEM_RES_CTLR=y
> CONFIG_NAMESPACES=y
> CONFIG_UTS_NS=y
> CONFIG_IPC_NS=y
> CONFIG_USER_NS=y
> CONFIG_PID_NS=y
> CONFIG_NET_NS=y
>
>
> # veth pair virtual network devices
> lxc.utsname = vsys1
>
> # === Internal control bridge
> lxc.network.type = veth
> lxc.network.flags = up
> lxc.network.link = br0
> lxc.network.name = eth0
> lxc.network.hwaddr = 00:09:00:09:00:01
> lxc.network.ipv4 = 192.168.18.25
>
> lxc.cgroup.memory.limit_in_bytes = 67108864
> #lxc.cgroup.shares=5
>
> *RAM memory of Host:*
>
>               total       used       free     shared    buffers     cached
> Mem:       1028904     472380     556524          0        352     350960
> -/+ buffers/cache:     121068     907836
> Swap:            0          0          0
>
> *RAM memory of container:*
>
> Mem:       1028904     508640     520264          0        352     384608
> -/+ buffers/cache:     123680     905224
> Swap:            0          0          0
>    




More information about the lxc-users mailing list