henrygd / beszel

A lightweight server monitoring hub with historical data, docker stats, and alerts.
MIT License
1.19k stars 46 forks source link

Strange/inconsistant Docker CPU usage graph #85

Closed lbalogh closed 1 month ago

lbalogh commented 1 month ago

Hi,

First of all, many thanks for this tool, which seems much more lightweight than a full Prometheus/InfluxDB/Grafana stack !

I have noticed a possible inconsistency in the Docker CPU usage graph. When my system is idle, the popup indicates that my paperless-ngx-redis1 and authelia-redis-1 containers each use 0.07% of the CPU. However, the left axis of the graph appears to show a usage of around 0.7%.

image

At 17:35, I started a Plex movie, and the graph shows a spike for all containers, even though their CPU usage remained the same (except plex, which is expected). For instance, both the paperless-ngx-redis1 and authelia-redis-1 containers still showed a CPU usage of 0.07% :

image.

Any idea ?

henrygd commented 1 month ago

It's a stacked area chart, so the y-axis is based on total CPU usage of all containers combined.

0.37+0.07+0.04+0.03+0.02×3+0.01 = 0.58%

The rest of your containers round down to 0% for display purposes, but all of them together probably push the mark slightly above 0.6%, which is what shows in the chart.

The order of the stack is based on the total CPU usage over the entire time period of the chart, which is why plex isn't at the top even though it has the biggest spike.

Let me know if I'm not understanding your point correctly.