[lxc-users] "ps auxf" always showing 0.0% for CPU usage in LXD container?

Tomasz Chmielewski mangoo at wpkg.org
Wed Mar 21 17:03:07 UTC 2018


Let's run this in a LXD container:

container# cat /dev/urandom|gzip - >/dev/null


Then see what CPU usage "ps auxf" shows (3rd column):

container# ps auxf
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root     18177  0.0  0.0   4632  1584 pts/0    R+   16:47  11:33  |      
  \_ gzip -
(...)

Then, the same in the host:

host# ps auxf
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
100000   14878 99.7  0.0   4632  1584 pts/0    R+   16:47  11:47      |  
  |       \_ gzip -
(...)

Why does the container show it incorrectly as 0.0?


Tomasz Chmielewski
https://lxadm.com


More information about the lxc-users mailing list