• [6.6.1] docker stats command for cpu load and memory load running almost constantly


    Derek
    • Annoyance

    The following command within 6.6.0 (and now confirmed in 6.6.1) seems to be constantly running:

    docker stats --no-stream --format={{.Container}} {{.CPUPerc}} {{.MemPerc}}

    USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
    root      8955 13.0  0.3  40972 26028 ?        Sl   09:55   0:00 docker stats --no-stream --format={{.Container}} {{.CPUPerc}} {{.MemPerc}}

    I am running unRAID on a low power consumption based system backed by an Intel Celeron J3455 processor so I don't always have spare cycles -- this command finishes after approximately 0.6 seconds and starts almost immediately again 24/7 (based on what I can see with the PID constantly changing) and it is generating a little bit of a load on my load average outputs.  It nearly always consumes 10 to 13% of my CPU while running.

     

    To remediate this, I would expect that this command should only run only when the docker page is being viewed on the Web UI, and ideally only if the advanced view is turned on as it is really only for informational needs.




    User Feedback

    Recommended Comments

    14 minutes ago, nicam said:

    I have the exact same issue, have you figured out what's the culprit of it?

    Is it really "the exact same"? You are using Unraid 6.6.1 just the same?

    Link to comment

    I'm on 6.6.6 using an Intel J1900 Processor but seeing the exact same behaviour with the docker stats command constantly showing up with new PIDs

    Link to comment

    docker stats does run constantly on unRaid 6.6.x  IMHO, there is no real need for it to unless you're on the docker tab, but for the time being it is what it is.  This isn't a bug report (as there's no bug, but its the design), and a feature req should be posted instead.

    Link to comment
    On 12/29/2018 at 6:43 AM, trurl said:

    Is it really "the exact same"? You are using Unraid 6.6.1 just the same?

    I can also confirm this behavior has not changed in any of the newer versions of Unraid but I did report it several months ago and to date, 6.6.6 also exhibits this behavior.

     

    I would still consider this a bug as Unraid is polling for these stats 24/7 and wasting CPU cycles on a relatively expensive command when it appears that it is not used for anything other than an informational UI display (which is not even visible unless the Advanced docker UI display is open).

    Link to comment

    The polling was designed to run constantly. On my system it takes 0.3% cpu.

     

    If this docker command has such a huge impact on the system, I am wondering how well docker containers run on such a system. Is the system powerful enough?

     

    That said, you can make a feature request and ask for a more suitable solution for lower end systems.

    Link to comment

    Docker runs really well on this system I'm running Plex, Sonarr and about 10 other Containers with no issue.
     

    Link to comment
    1 hour ago, nicam said:

    Docker runs really well on this system I'm running Plex, Sonarr and about 10 other Containers with no issue.
     

    I agree, I am running plex and some other dockers. Raw CPU horsepower doesn't really concern me here, it just seems like this is an expensive command on any level of processing power if it's strictly for a display that is rarely viewed. Just surfing through some of the docker bug reports on the stats command, they seem to be well aware that it is an expensive command to run and do not have a fix in place yet. e.g.: https://github.com/docker/for-linux/issues/190

     

    For example, my plex docker on unraid with hardware Intel Quick Sync transcoding of 1080p or 4k is able to easily serve my 2 endpoints at home without consuming much more than a constant 5-10% of CPU.  Other containers don't consume much either -- as is the case similar to full blown VMs, having available RAM seems to be more important in most cases.  I do run VMWare ESXi on a Xeon based server for most of my other needs that require more power, but I wanted to keep plex on my Unraid server because my Xeon does not have Intel Quick Sync.

     

    I'll work on submitting a feature request.

    Link to comment
    53 minutes ago, Derek said:

    I agree, I am running plex and some other dockers. Raw CPU horsepower doesn't really concern me here, it just seems like this is an expensive command on any level of processing power if it's strictly for a display that is rarely viewed. Just surfing through some of the docker bug reports on the stats command, they seem to be well aware that it is an expensive command to run and do not have a fix in place yet. e.g.: https://github.com/docker/for-linux/issues/190

     

    For example, my plex docker on unraid with hardware Intel Quick Sync transcoding of 1080p or 4k is able to easily serve my 2 endpoints at home without consuming much more than a constant 5-10% of CPU.  Other containers don't consume much either -- as is the case similar to full blown VMs, having available RAM seems to be more important in most cases.  I do run VMWare ESXi on a Xeon based server for most of my other needs that require more power, but I wanted to keep plex on my Unraid server because my Xeon does not have Intel Quick Sync.

     

    I'll work on submitting a feature request.

    Oh thank you very much, thanks to your comment I discovered that my CPU is QuickSync capable!

    Link to comment
    13 minutes ago, nicam said:

    Oh thank you very much, thanks to your comment I discovered that my CPU is QuickSync capable!

    No problem!

     

    I created a feature request here.  Thanks!

     

     

    Link to comment
    On 1/9/2019 at 11:27 PM, Derek said:

    I created a feature request here.

    I made an update as response to this feature request.

    The 'load' script is only started when docker containers are viewed in advanced mode, otherwise it is off.

    Link to comment
    3 hours ago, bonienl said:

    I made an update as response to this feature request.

    :(  So much for the next plugin I started working on:  CA unRaid Hacks

    Link to comment
    22 minutes ago, bonienl said:

    What? Hacking Unraid 😁

    I want some of that. Not sure I want it let loose on the users though.

    Link to comment
    8 hours ago, bonienl said:

    I made an update as response to this feature request.

    The 'load' script is only started when docker containers are viewed in advanced mode, otherwise it is off.

    That is amazing! Thank you! Can I send you a beer, coffee, etc? 😃

    Link to comment


    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.
    Note: Your post will require moderator approval before it will be visible.

    Guest
    Add a comment...

    ×   Pasted as rich text.   Restore formatting

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.


  • Status Definitions

     

    Open = Under consideration.

     

    Solved = The issue has been resolved.

     

    Solved version = The issue has been resolved in the indicated release version.

     

    Closed = Feedback or opinion better posted on our forum for discussion. Also for reports we cannot reproduce or need more information. In this case just add a comment and we will review it again.

     

    Retest = Please retest in latest release.


    Priority Definitions

     

    Minor = Something not working correctly.

     

    Urgent = Server crash, data loss, or other showstopper.

     

    Annoyance = Doesn't affect functionality but should be fixed.

     

    Other = Announcement or other non-issue.