Wrong CPU Usage on Podman #4018
Replies: 3 comments
-
😂 I don't personally use Podman, so I'm not sure. The CPU at the top can exceed 100% because it represents multiple CPUs. The CPU in the table row is below 100% due to potential CPU limits. Perhaps, you can debug a little. It would be too much work to set up something in Podman and test it. Nothing in the stats logic has changed for the last year. So this is either a bug for all or just Podman. |
Beta Was this translation helpful? Give feedback.
-
It does seems like Podman is returning the stat incorrectly (?) curl --unix-socket /run/user/1000/podman/podman.sock http://localhost/v5.0.0/libpod/containers/qbittorrent/stats {
"read": "2025-07-01T00:33:35.410552169+08:00",
"preread": "2025-07-01T00:33:30.403519222+08:00",
"pids_stats": {
"current": 21
},
"blkio_stats": {
"io_service_bytes_recursive": [],
"io_serviced_recursive": null,
"io_queue_recursive": null,
"io_service_time_recursive": null,
"io_wait_time_recursive": null,
"io_merged_recursive": null,
"io_time_recursive": null,
"sectors_recursive": null
},
"num_procs": 0,
"storage_stats": {},
"cpu_stats": {
"cpu_usage": {
"total_usage": 8096948784000,
"usage_in_kernelmode": 2808699651,
"usage_in_usermode": 8094140084349
},
"system_cpu_usage": 15477447696000,
"online_cpus": 16,
"cpu": 2.33230449879973,
"throttling_data": {
"periods": 0,
"throttled_periods": 0,
"throttled_time": 0
}
},
"precpu_stats": {
"cpu_usage": {
"total_usage": 8096832054000,
"usage_in_kernelmode": 2808668658,
"usage_in_usermode": 8094023385342
},
"system_cpu_usage": 15476903810000,
"online_cpus": 16,
"cpu": 0,
"throttling_data": {
"periods": 0,
"throttled_periods": 0,
"throttled_time": 0
}
},
"memory_stats": {
"usage": 11149312,
"limit": 16523120640
},
"name": "qbittorrent",
"Id": "6627a61b85c857aec1f85a97b388057321ce6cbec243ccb103653b4c04aa1d44",
"networks": {
"eth0": {
"rx_bytes": 36836539522,
"rx_packets": 77538910,
"rx_errors": 0,
"rx_dropped": 0,
"tx_bytes": 48656040643,
"tx_packets": 91134420,
"tx_errors": 0,
"tx_dropped": 0
},
"tun0": {
"rx_bytes": 6990044928,
"rx_packets": 35733666,
"rx_errors": 0,
"rx_dropped": 0,
"tx_bytes": 37885755076,
"tx_packets": 58284634,
"tx_errors": 0,
"tx_dropped": 0
}
}
} Based on the calculation in https://docs.docker.com/reference/api/engine/version/v1.51/#tag/Container/operation/ContainerExport and https://github.com/amir20/dozzle/blob/master/internal/docker/calculation.go: cpu_delta = cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage = 116730000 Seems like the correct value is already in percentage, so the multiply by 100 is not required (i.e. 3.43%). But still doesn't explain why the UI is showing 40~50%... Another way is to use the native Podman API: https://docs.podman.io/en/latest/_static/api.html#tag/containers/operation/ContainersStatsAllLibpod, but I'm probably asking too much here |
Beta Was this translation helpful? Give feedback.
-
Hmm come to think of it, this is a duplicate #3553 I think Podman had a bug that's not consistent with Docker. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
🔍 Check for existing issues
How is Dozzle deployed?
Standalone Deployment
📦 Dozzle version
v8.13.3
✅ Command used to run Dozzle
podman run --name dozzle --rm -v /run/user/1000/podman/podman.sock:/var/run/docker.sock:z ghcr.io/amir20/dozzle:v8.13.3
🐛 Describe the bug / provide steps to reproduce it
First of all great project!
However I notice the CPU seems to be display wrongly for one of my container:
My qBittorrent is seeding some linux distro, but the CPU usage is no where near that. Below is the output of
podman stats
:Snippet from the podman API response (curl --unix-socket /run/user/1000/podman/podman.sock http://localhost/v5.0.0/libpod/containers/stats | jq)
💻 Environment
📜 Dozzle logs are required for debugging purposes. You may need to enable debug mode. See https://dozzle.dev/guide/debugging.
{"level":"info","version":"v8.13.3","time":"2025-06-30T15:20:21Z","message":"Dozzle version v8.13.3"}
{"level":"info","version":"v8.13.3","clients":1,"time":"2025-06-30T15:20:21Z","message":"Connected to Docker"}
{"level":"info","version":"v8.13.3","time":"2025-06-30T15:20:21Z","message":"Accepting connections on :8080"}
📸 If applicable, add screenshots to help explain your bug
No response
Beta Was this translation helpful? Give feedback.
All reactions