Repository navigation
Container CPU Total API incorrect? #3597
Replies: 2 comments
|
i convert the issue into a discussion as soon as a bug is detected in Glances. Can you copy/paste the result of the curl http://:61208/api/4/containers whenthe issue is detected in HA ? Thanks ! |
|
Hard to tell what's going on there... I had another one of those periods, but at 4am. It's hard to catch the event manually. I managed to do so a while back, but then forgot to keep the data. So I let HA log the data. It's not logging raw JSON, but (I guess) a Python representation, plus not only containers, but everything (180kB per request). I tried my best to get raw data for the containers out of it: [
{
"key": "name",
"name": "lrclib-rs",
"id": "b610345fc92d80dbe7dae8ef170cb230c094f360937ea1c4365216e9845c8791",
"status": "running",
"created": "2026-05-26T21:13:42.048463498Z",
"command": "lrclib serve --port 3300 --database /data/db.sqlite3",
"io": {
"cumulative_ior": 15062831104,
"cumulative_iow": 32768,
"time_since_update": 59,
"ior": 131072,
"iow": 0
},
"cpu": {
"total": 100.94250614250615,
"limit": 4
},
"memory": {
"usage": 12586975232,
"limit": 16647147520,
"inactive_file": 7317876736
},
"network": {
"cumulative_rx": 52210886,
"cumulative_tx": 184709285,
"time_since_update": 59,
"rx": 6666,
"tx": 5697
},
"io_rx": 2221,
"io_wx": 0,
"cpu_percent": 100.94250614250615,
"memory_percent": null,
"network_rx": 112,
"network_tx": 96,
"ports": "3300->3300/tcp",
"uptime": "a week",
"image": [
"lrclib-rs:latest"
],
"cpu_limit": 4,
"memory_usage": 12586975232,
"memory_inactive_file": 7317876736,
"memory_limit": 16647147520,
"engine": "docker"
},
{
"key": "name",
"name": "wud",
"id": "ac5c178bf37f256763383b4f0d8be3102ea8a076b26eef354e8c776252b32fac",
"status": "healthy",
"created": "2026-06-16T21:11:24.481668296Z",
"command": "/usr/bin/entrypoint.sh node dist/index.js",
"io": {
"cumulative_ior": 94793728,
"cumulative_iow": 1998848,
"time_since_update": 59,
"ior": 0,
"iow": 0
},
"cpu": {
"total": 0.6124137931034483,
"limit": 4
},
"memory": {
"usage": 188149760,
"limit": 16647147520,
"inactive_file": 18644992
},
"network": {
"cumulative_rx": 18474749,
"cumulative_tx": 11048236,
"time_since_update": 59,
"rx": 0,
"tx": 0
},
"io_rx": 0,
"io_wx": 0,
"cpu_percent": 0.6124137931034483,
"memory_percent": null,
"network_rx": 0,
"network_tx": 0,
"ports": "3000->3000/tcp",
"uptime": "a week",
"image": [
"getwud/wud:latest"
],
"cpu_limit": 4,
"memory_usage": 188149760,
"memory_inactive_file": 18644992,
"memory_limit": 16647147520,
"engine": "docker"
},
{
"key": "name",
"name": "glances-glances-1",
"id": "3eb7f661b6a122030745599750a886ac80fd22de01a178c36ec8b9e86060a04a",
"status": "running",
"created": "2026-06-17T04:28:36.446343997Z",
"command": "/bin/sh -c /venv/bin/python${PYTHON_VERSION} -m glances ${GLANCES_OPT}",
"io": {
"cumulative_ior": 147456,
"cumulative_iow": 1478656,
"time_since_update": 59,
"ior": 0,
"iow": 0
},
"cpu": {
"total": 0.37474201474201474,
"limit": 4
},
"memory": {
"usage": 214777856,
"limit": 16647147520,
"inactive_file": 1478656
},
"network": {
"cumulative_rx": 9777627,
"cumulative_tx": 149374789,
"time_since_update": 59,
"rx": 897,
"tx": 15630
},
"io_rx": 0,
"io_wx": 0,
"cpu_percent": 0.37474201474201474,
"memory_percent": null,
"network_rx": 15,
"network_tx": 264,
"ports": "61208->61208/tcp,61209->61209/tcp",
"uptime": "6 days",
"image": [
"nicolargo/glances:latest"
],
"cpu_limit": 4,
"memory_usage": 214777856,
"memory_inactive_file": 1478656,
"memory_limit": 16647147520,
"engine": "docker"
},
{
"key": "name",
"name": "dockge-dockge-1",
"id": "fbd44734e9a68bbc342b281498d2c1202f8fb8812a187bb60ebb1040ab30c4a4",
"status": "healthy",
"created": "2026-05-26T20:50:24.212551607Z",
"command": "/usr/bin/dumb-init -- tsx ./backend/index.ts",
"io": {
"cumulative_ior": 184229888,
"cumulative_iow": 282624,
"time_since_update": 59,
"ior": 0,
"iow": 0
},
"cpu": {
"total": 0.1295331695331695,
"limit": 4
},
"memory": {
"usage": 364044288,
"limit": 16647147520,
"inactive_file": 19329024
},
"network": {
"cumulative_rx": 483571,
"cumulative_tx": 1089474,
"time_since_update": 59,
"rx": 0,
"tx": 0
},
"io_rx": 0,
"io_wx": 0,
"cpu_percent": 0.1295331695331695,
"memory_percent": null,
"network_rx": 0,
"network_tx": 0,
"ports": "5001->5001/tcp",
"uptime": "a week",
"image": [
"louislam/dockge:1"
],
"cpu_limit": 4,
"memory_usage": 364044288,
"memory_inactive_file": 19329024,
"memory_limit": 16647147520,
"engine": "docker"
}
]Now a single snapshot isn't really helpful I guess, as there can be spikes, obviously. I'd probably need a series of values, representing that saw-tooth shape. But I haven't seen that recently, and debug logging glances in HA for days will leave me with huge log files... |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Check the bug
Unfortunately the keywords are rather generic ("cpu", "container"), didn't find, neither open nor closed
Describe the bug
Every now and then, often only after days or weeks of no issues at all, the API (
/api/4/containers) would suddenly report 100 forcpu.totalfor one particular container. The regular web UI would show single digit values at the same time, as wouldtopin a terminal session. I'm using Home Assistant with the Glances integration, and in those cases I'm seeing data like that:The blue line is the container's CPU load.
To Reproduce
Unfortunately I can't reproduce this. It would simply happen at some point. This container has been up for 11 days.
Environement (please complete the following information)
Debian 13.5/TrixieGlances version: 4.5.4glances --issuesproduces a long list, summary:EDIT: I've edited the version info. It seems the container was updated only an hour or two ago... it must have been using
4.5.4before. When the issue happened. Let's see whether it happens again in a bit. Screenshot was taken last night, before the upgrade happened.All reactions