/proc/meminfo:Shmem same on containers and host

Skip to first unread message

Alexis Huxley

Jan 4, 2022, 7:17:03 AMJan 4
to lxc-users
Hi, inside an LXC container, /proc/meminfo:MemTotal corresponds with the container-specific restrictions, but /proc/meminfo:Shmem is the value from the host that the container runs on.

Is this a bug or is it meant to be like this?

The reason I ask is that CheckMK monitors the ratio between the two values and triggers an alert when a threshhold value is exceeded. On the host ('fiori' in the output below) and on containers that genuinely need a lot of  memory then the ratio is always well below the threshold. But on one container ('mandala' in the output), which needs only a little memory, the ratio is high enough to trigger alerts.

I understand that I can modify the CheckMK's threshold for this host, but before I do that I want to know whether (a) I should do thar or whether (b) I should submit an LXC bug report or whether (c) it's a fixed bug that just hasn't reached the distro I use (though googling didn't show that).

Any advice please?

In case it helps: this is Debian 11 running stock LXC (4.0.6) and stock lxcfs (4.0.7).


farfalle# for HOST in fiori orzo armonie gnocchi paccheri mandala rotelle bigoli; do echo "=== $HOST ==="; echo; ssh -n $HOST "egrep '^(Shmem|MemTotal):' /proc/meminfo"; echo; done
=== fiori ===

MemTotal:       32121356 kB
Shmem:            240100 kB

=== orzo ===

MemTotal:        2097152 kB
Shmem:            240100 kB

=== armonie ===

MemTotal:        2097152 kB
Shmem:            240100 kB

=== gnocchi ===

MemTotal:        2097152 kB
Shmem:            240100 kB

=== paccheri ===

MemTotal:        2097152 kB
Shmem:            240100 kB

=== mandala ===

MemTotal:        1048576 kB
Shmem:            240100 kB

=== rotelle ===

MemTotal:        4194304 kB
Shmem:            240100 kB

=== bigoli ===

MemTotal:        2097152 kB
Shmem:            240100 kB


Reply all
Reply to author
0 new messages