[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lxc-users
Subject:    Re: [lxc-users] "ps auxf" always showing 0.0% for CPU usage in LXD container?
From:       Simos Xenitellis <simos.lists () googlemail ! com>
Date:       2018-03-28 14:29:16
Message-ID: CAPtVWc5zYw14cUUxxSoTT58yeWVwkXaR764z0WnY_6-KM91hhw () mail ! gmail ! com
[Download RAW message or body]

On Wed, Mar 21, 2018 at 7:03 PM, Tomasz Chmielewski <mangoo@wpkg.org> 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
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic