Sysinfo intercept in LXD 5.1

I have seen from the LXD 5.1 news (LXD 5.1 has been released) that now LXD can intercept sysinfo. The example shows how the memory seen within the container reflects the container memory limits. However, when using LXD 4.0.7 I see the same behaviour without any additional configuration:

 $ lxc launch images:debian/11 a1 -c limits.memory=1GiB
 Creating a1
 Starting a1
 $ lxc exec a1 -- free -m
                total        used        free      shared  buff/cache   available
 Mem:            1024          20         966           0          36        1003
 Swap:           1024           0        1024

Even with LXC 3.0.3 I see the same behaviour.
So I am a bit confused on how the new feature differs from the default behaviour in previous versions of LXD.

This feature is only really beneficial to os images or applications that don’t consult /proc/meminfo (which is emulated by LXCFS). Debian userland tools support proc.

That’s clear now.
Thank you very much for the clarification!

1 Like