On Wed, Mar 21, 2018 at 7:03 PM, Tomasz Chmielewski <[email protected]> wrote:
> 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?
>

If you try with 'top' in the container, it shows correctly the %CPU to be 100%.
I think the 'ps' always shows 0.0 for %CPU in any process when run in
the container.
It could be related to LXCFS. I run LXD 3.0 beta, thus the same is
happening with LXCFS 3 (beta).

Simos
_______________________________________________
lxc-users mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-users

Reply via email to