[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

LimitRange doesn't apply to swap space - is this the intended behavior?



Hello
 
I am implementing resource limits and I have noticed that the memory limit apparently only applies to physical ram (resident set size) and not to swap space.
 
To be more specific:
If I limit a container to 300 MiB of memory and run "stress --vm 1 --vm-bytes 2000M" then that process will take the 300 MiB of RAM and on top of that 1700 MiB of swap space. That makes resource limits for memory rather pointless if you have swap space enabled because your apps aren't going to behave in a predictable way: Sometimes (enough free swap space) they will run and sometimes (swap is full) they will crash. The only workaround I see at the moment is disabling swap space entirely but I'd like to avoid that if possible.
 
Is this the intended behavior or is that a bug?
 
Regards
v

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]