Closed jiasli closed 2 years ago
iotop
uses kernel functionality that is not available in containers, unless the container has the –privileged
flag (which is a bad idea on its own).
Can you retest your scenario with the latest git tree of iotop-c? There are changes that address this situation by emitting a proper error message.
Thanks @bbonev for the quick response. Indeed, the latest version shows a proper error message:
# iotop --version
iotop 1.21
# iotop
nl_init: couldn't get netlink family id
but it still seems not to work with --privileged
:
> docker run -it --rm --privileged fedora
# yum install git gcc make ncurses-devel pkgconfig -y
# git clone https://github.com/Tomas-M/iotop
# cd iotop
# make -j
# make install
# iotop
nl_init: couldn't get netlink family id
BTW, fixed a small error in the URL: https://github.com/Tomas-M/iotop/pull/35 😉
Maybe it is my mistake (--privileged) because I am not too well aware of containers' terminology and options - that should be something like super-privileged or admin-privileged. While it may be a good option for testing, running a container in that mode is a big NO...
iotop
uses Linux kernel's netlink interface for fetching the processes' IO counters and this part of the kernel is not (yet) virtualised and hence not accessible in containers. See #28 for more info.
or