Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lxc-info 4.0.2 gives fewer information on pure cgroupv2 #3389

Open
emojifreak opened this issue Apr 19, 2020 · 2 comments
Open

lxc-info 4.0.2 gives fewer information on pure cgroupv2 #3389

emojifreak opened this issue Apr 19, 2020 · 2 comments

Comments

@emojifreak
Copy link

Host Linux: Ubuntu 20.04 with pure cgroupv2 (systemd.unified_cgroup_hierarchy=1)
Guest Linux: Ubuntu 19.10

LXC version:

# dpkg-query -W | grep lxc
liblxc-common	1:4.0.2-0ubuntu1
liblxc1	1:4.0.2-0ubuntu1
lxc-utils	1:4.0.2-0ubuntu1

In the Ubuntu default cgroup hierarchy (hybrid), lxc-info gives:

# lxc-info -n eoan-priv
Name:           eoan-priv
State:          RUNNING
PID:            2721
IP:             10.0.3.57
CPU use:        2.23 seconds
BlkIO use:      59.02 MiB
Memory use:     92.70 MiB
KMem use:       14.72 MiB
Link:           veth9qvFNx
 TX bytes:      1.63 KiB
 RX bytes:      8.07 KiB
 Total bytes:   9.70 KiB

On the other hand, when Host Linux is in pure cgroupv2, lxc-info only gives

# lxc-info -n eoan-priv
Name:           eoan-priv
State:          RUNNING
PID:            2825
IP:             10.0.3.57
Link:           vethcASHP0
 TX bytes:      2.08 KiB
 RX bytes:      9.52 KiB
 Total bytes:   11.60 KiB

This seems related to #3372

systemctl status gives almost as much information as lxc-info in the hybrid cgroup hierarchy as follows:

# systemctl status lxc@eoan-priv
● lxc@eoan-priv.service - LXC Container: eoan-priv
     Loaded: loaded (/lib/systemd/system/lxc@.service; disabled; vendor preset: enabled)
     Active: active (running) since Sun 2020-04-19 20:10:38 JST; 25s ago
       Docs: man:lxc-start
             man:lxc
   Main PID: 4226 (lxc-start)
         IP: 0B in, 696B out
         IO: 0B read, 16.0K written
      Tasks: 19 (limit: 19029)
     Memory: 32.0M
        CPU: 1.937s
     CGroup: /system.slice/system-lxc.slice/lxc@eoan-priv.service
             ├─lxc.monitor.eoan-priv
             │ └─4226 /usr/bin/lxc-start -F -n eoan-priv
             └─lxc.payload.eoan-priv
               ├─init.scope
               │ └─4243 /sbin/init
               └─system.slice
@weriyard
Copy link

I would to confirm this issue on Debian Bullseye and lxc 4.0.6

root@vdev1:/etc/apparmor.d/lxc# lxc-info one-706
Name: one-706
State: RUNNING
PID: 402463
IP: 192.168.184.2
Link: one-706-0
TX bytes: 1.94 KiB
RX bytes: 40.35 KiB
Total bytes: 42.29 KiB
Lack inforamtions about mem usage.

@graysky2
Copy link
Contributor

graysky2 commented Apr 1, 2024

According to the man page:

       -S, --stats
              Just print the container's statistics.  Note that for performance reasons the kernel does not  account  kernel
              memory use unless a kernel memory limit is set. If a limit is not set, lxc-info will display kernel memory use
              as 0. A limit can be set by specifying

                          lxc.cgroup.memory.kmem.limit_in_bytes = number

              in your container configuration file, see lxc.conf(5).

But even defining that key in my container config results in the lack of memory use:

# grep kmem /var/lib/lxc/p2/config
lxc.cgroup.memory.kmem.limit_in_bytes = 10000000

# lxc-info -n p2 -S
Link:           vethUozWOk
 TX bytes:      23.01 KiB
 RX bytes:      28.49 KiB
 Total bytes:   51.49 KiB

@brauner any thoughts?

EDIT: I tried lxc-info from the latest git but the results were the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants