Join GitHub today
systemd-nspawn seems to ignore MemorySwapMax parameter #6074
systemd version the issue has been seen with
NOTE: Do not submit bug reports about anything but the two most recently released systemd versions upstream!
(ck patches with stock kernel configuration).
The host has 8G RAM and 8G swap.
In case of bug report: Expected behaviour you didn't see
I created systemd-nspawn container
Then I run test program in the container
I would expect that program will fail because it requires more memory (about 2G) than the container suppose to have.
In case of bug report: Unexpected behaviour you saw
But the program runs fine except I turn off swap on host. Moreover, it runs fine regardless of
Besides that value
In case of bug report: Steps to reproduce the problem
P.S. It might be that I incorrectly understand the
Thanks for the bug report.
It appears that you're not using the unified cgroup hierarchy. Could you attach the output of
systemd-analyze set-log-level debug systemctl start <container-name> journalctl --sync journalctl -u <container-name>
? Do you see something like
shows that that host don't use unified cgroup hierarchy?
No, this is copy-pasted from
Below is part of
P.S. Instead of
This shows that the hybrid hierarchy is being used, so
By the way, there was an attempt to add
Thank you, that works perfectly fine. I added
Actually I was a bit surprised that now it works differently: I used the same settings in
After tests I thought that "may go above the limit" means that it will reach the limit of "MemoryMax", from the manual:
Now test shows me that I was wrong.
Anyway, as it works as I want I'm happy. As I understand, the new (?) unified cgroup hierarchy will be default after some time, is it?