CPU% displayed in the OpenPanel > Dashboard can exceed 100%, which can be confusing since most users expect progress to be limited to 0-100%.
In Docker, 100% corresponds to a single CPU core. For example:
- If a service is allocated 1.5 CPU cores, the usage can range from 0% to 150%.
- If a plan includes 4 CPU cores, the maximum displayed value can reach 400%.
How Docker calculates CPU usage
Docker calculates CPU usage using the formula:
cpuPercent = (cpuDelta / systemDelta) * onlineCPUs * 100.0
Reference
How OpenPanel collects stats
Docker provides a stats command (Docs) that can stream live usage. With the --no-stream flag, it reports usage only once.
OpenPanel uses this approach in the opencli docker-collect_stats command.
- The command is run hourly via a cron job and collects usage stats for all users.
- The data is stored per user and displayed on both the Dashboard and the Resource Usage pages.
How OpenPanel displays stats
On the frontend, stats are accessible via /api/docker_stats (example).
When the Dashboard page loads, an AJAX request fetches this data and renders it in the Usage widget.
The data is cached and refreshed either manually using:
opencli docker-collect_stats USERNAME
or automatically by the hourly cron job:
opencli docker-collect_stats --all