Skip to content

docker stats API response not matching with actual usage in container #8640

@srik65

Description

@srik65

Summary

I'm trying to calculate CPU usage from docker stats response json. We observed that "system_cpu_usage" from "cpu_stats" and "precpu_stats" are always same in every response from VCH and it is giving invalid CPU usage details upon using CPU calculation.

vmstat/top is showing 100% and stats API response gave 0.36% upon calculation, even admiral showing 0.36% as utilization at same time. Would like to check if it is known issue or any mis-configuration on VCH causing this issue. Could you give us some pointers to debug more on this.

FYI, we used CPU calculation from here.,
https://github.com/docker/docker/blob/eb131c5383db8cac633919f82abad86c99bffbe5/cli/command/container/stats_helpers.go#L175

Environment information

VMware Product: VMware vCenter Server
VMware OS: linux-x64
VMware OS version: 6.7.0
Server: 1.5.4

See also

Troubleshooting attempted

  • Searched GitHub for existing issues. (Mention any similar issues under "See also", above.)
  • Searched the documentation for relevant troubleshooting guidance.
  • Searched for a relevant VMware KB article.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions