tjb_altf4 Posted December 25, 2021 Share Posted December 25, 2021 Currently Docker CPU usage shown on Docker page shows CPU usage as a percentage of the full system core count, unfortunately this behaviour extends to when a container has CPUs pinned, which is where a user has configured the container with less CPU cores (vcpu). In this example on a 32 vcpu machine, and with a container configured for only 2 vcpu shows a less meaningful fractional percentage. Instead I propose this usage should be based on actual available vcpu, which is more meaningful for the purpose of monitoring cpu usage. The below mockup shows current metrics, and the same usage if displayed relative to allocated resources. Note that container memory usage already displays this relative behaviour. This machine has 64GB of RAM, but this container is restricted to 8GB though extra parameter --memory=8GB Container CPU pinning for context 1 Quote Link to comment
Squid Posted December 25, 2021 Share Posted December 25, 2021 Yeah, currently the stats are returned directly via "docker stats" divided by the core count in the system (so it's normalized to a max of 100% - docker stats by itself would actually return 0.52*32 = 16.64%) While I don't have any real issues with what you're proposing, one downside is that if you ever add up the percentages they could quite easily exceed 100% Quote Link to comment
Recommended Posts
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.