• [6.6.0 RC1] Docker CPU utilization reporting over 100%


    jbartlett
    • Annoyance



    User Feedback

    Recommended Comments

    Not that the display is correct, but the CPU load being reported is identical to

    docker stats

    which means that the % needs to actually be divided by the number of cores in the system to get a value from 0-100

    Link to comment
    3 hours ago, Squid said:

    Not that the display is correct, but the CPU load being reported is identical to

    
    docker stats

    which means that the % needs to actually be divided by the number of cores in the system to get a value from 0-100

    Also dividing it by system cores or pinned cores, which makes more sense? Or provide the option for both? I'm unsure which would be more useful really

    Link to comment
    7 hours ago, Zack Pollard said:

    Also dividing it by system cores or pinned cores, which makes more sense?

    My answer is pinned cores. The stat is CPU usage of the container, and if one has pinned the cores that's the container's allocated cpu. Therefore (100% cpu) ==  (1 / ( X pinned cores) ) * ( sum( X pinned cores usage)   [ unit analysis: percentage = (no units)(percentage) ; OK ] 

     

    If no pinned cores then let "X pinned cores" equal one, prevents divide by 0 and goes away in equation. 

     

    An argument for this arrangement, say a user is unsure how much cpu to provision for a server, the user will better presentation of any over-head as it's provisioned. If the equation was 1/(all cores) if the container maxes out 100% would register as X / (all cores), and I could see some users think the container is OK because the CPU is never maxed - all the while the container could be choked up. 

     

    Just my two-cents when I saw this bug today.

     

    • Upvote 1
    Link to comment
    18 minutes ago, Jcloud said:

    My answer is pinned cores. The stat is CPU usage of the container, and if one has pinned the cores that's the container's allocated cpu.

     

    This makes sense. If no cores / threads are pinned for the container then the CPU percentage should be calculated from whatever cores / threads that are available for the container to use.

     

    And this brings up another scenario. What about isolated cores / threads that are used for VM's? Ideally you would want to exclude any isolated cores / threads used for VM's from your CPU utilization calculation.

    Link to comment
    1 hour ago, Jcloud said:

    My answer is pinned cores. The stat is CPU usage of the container, and if one has pinned the cores that's the container's allocated cpu.

    Yea I think this makes the most sense for the reasons you mentioned. 

     

    37 minutes ago, GHunter said:

    Ideally you would want to exclude any isolated cores / threads used for VM's from your CPU utilization calculation.

    Yea that would be ideal but unsure how easy that'll be considering that unraid don't provide support for isolation in the panel currently (although I hope they do soon). This would be great though if it could be done for container's that aren't pinned :) 

    Link to comment
    3 hours ago, Zack Pollard said:

    Yea I think this makes the most sense for the reasons you mentioned. 

     

    But then the next post / defect report will be about why is the total CPU percentage (adding up the column) go over 100%?

    Link to comment
    1 minute ago, Squid said:

    But then the next post / defect report will be about why is the total CPU percentage (adding up the column) go over 100%?

    Could just make it configurable in docker settings, or just put it in the help section on the page. 

    Link to comment

    Doesn't matter to me, but I would think that the Docker Page is simply a rough tool to determine the CPU usage of the container (in which case it is divided by number of cores).  If you want actual details, then you should be hitting NetData or even cAdvisor

    • Upvote 2
    Link to comment
    1 minute ago, Squid said:

    Doesn't matter to me, but I would think that the Docker Page is simply a rough tool to determine the CPU usage of the container (in which case it is divided by number of cores).  If you want actual details, then you should be hitting NetData or even cAdvisor

    I agree, and run both of these tools. However I still believe it's useful for light users of docker to have a tool that provides them with a simple overview of the container, which this would if divided by the pinned cores. 

    Link to comment

    Same result.  Over 100% is still possible, until someone decides whether to divide the stats returned by docker either by number of pinned cores or my preference, the number of cores present

    Link to comment

    The current implementation uses the standard calculation of Docker stats.

    cpuPercent = (cpuDelta / systemDelta) * float64(len(v.CPUStats.CPUUsage.PercpuUsage)) * 100.0

    It is unclear (to me) whether docker takes all cores or just the allocated cores in their formula

    Link to comment
    1 hour ago, bonienl said:

    It is unclear (to me) whether docker takes all cores or just the allocated cores in their formula

    Someone would have to run something like Plex (ugh) pinned to a single core, and maxing itself out on a transcode to see what the CPU % returned by docker stats is.  My guess would be that docker stats does not take into consideration pinned cores..  (IE: it would return 100% on a single core.  Pinned to 2 cores maxed out I'm guessing it would return 200%)  Only a guess though

    Edited by Squid
    Link to comment

    my plex basically crashes on 6.6.0 not using pinning at all most i have gotten with it is about 1 hour before it starts happening again i cannot stop the plex docker container it just hangs for at least 15min before i try and stop the array (it fails to stop all services and hangs so forced to do hard boot

    Link to comment

    I have two cores pinned at 100% just trying and waiting for my plex docker to stop (10min and wont stop) i do not want to hard boot this again whats going on with docker? (im not using pinning at all find it tends to break the dockers to not working anymore)

    Link to comment

    just noticed while plex is pinning two of my 8 threads all my shares unmount and the server is basically usless i cant do anything..logs nope wont load system is pretty much locked up other than a gui i cant change any setting either

     

    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.