[ZBXNEXT-6842] Zabbix Template App Docker report wrong metrics for Container Memory Usage Created: 2021 Aug 20  Updated: 2024 Jul 25

Status: Open
Project: ZABBIX FEATURE REQUESTS
Component/s: None
Affects Version/s: 5.4.3
Fix Version/s: None

Type: Change Request Priority: Medium
Reporter: Arpad Zsoldos Assignee: Unassigned
Resolution: Unresolved Votes: 3
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Debian GNU/Linux 10 (buster) 4.19.0-10-amd64 #1 SMP Debian 4.19.132-1 (2020-07-24) x86_64 GNU/Linux


Attachments: PNG File Screenshot 2021-08-20 at 10.54.33.png     PNG File Screenshot 2021-08-20 at 10.54.49.png     PNG File image-2024-07-25-19-45-42-893.png    

 Description   

Steps to reproduce:

  1. We've got a docker logrotate container which is rotating  a specific path with logs every day at midnight using cron
  2. At midnight the container memory usage spiked from 63Mib to 93Gib in a few min.
  3. Zabbix was still showing in graphs the "last" is still 93Gib even after 9 hours after the container spiked
  4. Also i received an email as an alert, if it is more than 10 GB we receive an alert.
  5. Now (after 9h) i went on the server and ran "docker stats" and the mem usage for that container was 63Mib but on the Zabbix graph was still showing me 93Gib
  6. After i restarted the container, the zabbix graphs started to show the correct numbers same as the "docker stats"
  7. Also, the total memory of the server didn't spiked or changed so i think those 93GiB are not real 
  8. Usually when we have other containers spiking in memory then the total memory of the server is spiking as well means it is taking from the total memory of the host

Result:
In one screenshot you see the total memory of the VM that is not spiking 93GiB in memory

The other screenshot you see the container spiking to 93 Gib in memory and not releasing until i restarted 

However docker stats showed 63MiB at that time (i don;t have screenshot for this)
Expected:
I expect to see in Zabbix Graphs the same numbers as "docker stats"

 



 Comments   
Comment by Sasu Kaipio [ 2024 Jul 25 ]

Encountered on 6.4 as well.

Container's actual usage reported by `docker stats` is `5.757 Gb` while Zabbix is reporting `46.81 Gb`. In the graphs it looks like it is flatlining and is stuck to 46.81 Gb (the top one):

The two bottom ones are closer to what `docker stats` report and are probably correct.

Generated at Mon Apr 07 09:12:33 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.