portainer: Container CPU stats incorrectly reported
BUG REPORT INFORMATION
I have a docker swarm mode service with a limit of cpu set to 0.1. Using the cli: docker stats I can see the CPU% shown correctly ranging from 0.00% to 10.xx%. However, in portainer, and for the same time range, it shows values up to 600%. When I change refresh rate to 10s instead of 5s, I get smaller percentages, but still high (400%). Looks like a bug in aggregating cpu stats across the time.
Steps to reproduce the issue:
-
Deploy a service with resource limit:
deploy: resources: limits: cpus: ‘0.1’
-
Do
docker stats <container_id> -
Open portainer stats page for this container
-
Watch the charts

Technical details:
- Portainer version: 1.15.1
- Target Docker version (the host/cluster you manage): 17.09-ce swarm mode on
- Platform (windows/linux): linux
- Command used to start Portainer (
docker run -p 9000:9000 portainer/portainer): I use a stack file similar like portainer-endpoint repo. - Target Swarm version (if applicable):
- Browser: Chrome
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 1
- Comments: 32 (4 by maintainers)
i run portainer with docker image portainer/portainer:pr1512 , cpu stats was much different with what i got when i ran cmd ‘docker stats xxxxx’,how to fix it?