LXC - limit resources

I have two LXC containers on TO, just after start them I have the 72% free RAM, but after using them (download with Transmission, streaming with MiniDLNA, etc) some times I have only the 2% free RAM and a few use of swap.

I have been searching about this and I have only found how to limit by container. I want limit the two containers to use 50% of RAM and CPU, not one of they 25% and the other 25%.

Is this possible?

isn’t it this problem? Are those resources really used?


It might be possible (not tested, only a feeling) to configure it in /sys/fs/cgroup and make LXC create its entries as subgroup of what you configure.

After a while, you will see that the memory allocation drops dramatically!

Thanks @vorner I will search about that and try it when I have a little of time.