Because Ubuntu 21.10 ship with Cgroup V2 and my project seems to need memory limitations I decided to use it, but I have some problems.
I need a lot of RAM to test an idea, so because my processor can't accept more than 128G ram I decided to get some RAM from another server as SWAP.
So I mounted a partition from 512G RAM on second server, and used NFS-server to let my first server to access it as a client.
Those two servers have a 40Gbps connection between them so is enough speed for me to make the test.
On the first server I mounted the NFS partition from the second server and made a swap file on it and I was ready to go with 128G ram and 512G swap.
After I started the test and past over the 128G ram, my server freeze because running utilities have no room to work in ram and I decided to limit the usage of memory with cgroup.
The problem:
When I set MemoryHigh limit is working nice, after the limit, is going and fill the swap but is stops at the same limit as RAM. Somehow cgroup limit the use of SWAP at exactly same capacity as RAM memory. So if I set MemoryHigh=110G, I can go 110G on ram and 110G on swap, anyone knows how to config cgroup to let the swap unlimited ?
paint description image