Ad Widget

Collapse

Difference between docker template and docker stats

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sbelkin
    Junior Member
    • Dec 2016
    • 17

    #1

    Difference between docker template and docker stats

    Hi,

    I'm using the Docker template and I get different values on item "Container /server-web-reporting-1: Memory usage" than of docker stats.

    With zabbix:

    Code:
    zabbix_get -s dockerhost -k docker.container_stats["/web-reporting-1"] | grep -o "memory.*stats"
    memory_stats":{"usage":9817108480,"max_usage":10882347008,"stats zz0.k1xci57zx2jzz
    WIth docker stats:

    Code:
    docker stats --no-stream web-reporting-1
    CONTAINER ID   NAME                     CPU %     MEM USAGE / LIMIT    MEM %     NET I/O   BLOCK I/O        PIDS
    801396c54212   web-reporting-1   14.03%    5.24GiB / 11.58GiB   45.27%    0B / 0B   306GB / 11.8GB   25

    Why does difference occur?

    Thanks in advance​
  • ferpaesdias
    Junior Member
    • Apr 2023
    • 1

    #2
    Hi,
    I had the same problem. In the Docker documentation I found this:

    On Linux, the Docker CLI reports memory usage by subtracting cache usage from total memory usage. The API does not perform this calculation, but provides the total memory usage and cache amount so that clients can use the data as needed. Cache usage is defined as the value of the total_inactive_file field in the memory.stat file on cgroup v1 hosts.

    Comment

    Working...