Lxc-top for lxc v2.20?

(Ron Kelley) #1

Running lxc v2.20 on Ubuntu 16.04 and am looking for the lxc-top command. It seems this command was working with lxc v1.0. I can’t find any packages in the apt archive that matches this name.

Any pointers?


Generally speaking and in the spirit of ‘teach a man to find files by himself and he will be able to install apps on Ubuntu all his life’, there is apt-file
sudo apt install apt-file -> update the cache when it asks you
apt-file search lxc-top
apt-file is a real life saver when you are trying to compile an application (you know this ./configure moment where you learn that a file is missing but you don’t know what package to install)

Anyway, lxc-top still exists in the lxc-utils package. Sadly it can’t be used with lxd.

(Ron Kelley) #3

Thanks for the info. I knew about the “apt cache search” function but did not know about the apt-file command. Very cool!

As for lxd-top, I was hoping a new updated version was available, but alas, it is not. Instead, I installed sysdig to monitor the VM containers. Simos created a really cool page that explains how to use sysdig and falco:


FTR, what essential feature do you feel brings sysdig+falco that lxc-top is missing ?

(Ron Kelley) #5

I never used lxc-top before. I just needed a tool that would list all running containers and their respective performance (RAM, CPU, etc).


after testing a bit, it’s still possible to use lxc-top, even with lxd.
For example with lxd snap 3.12, this will work

sudo lxc-top -P /var/snap/lxd/common/lxd/containers

even if from time to time an error message is flashing about an unability to read a cgroup item memory.memsw in bytes (not sure about the message it’s disappearing fast)


You can use systemd-cgtop (no sudo required).

It shows the stats per Control Group (cg), which, in LXC/LXD, correspond to each container.
You get

  1. Number of tasks
  2. %CPU
  3. Memory
  4. Network Input/s and Output/s