I have a contanerized microservice (i.e. running docker container) for which i have assigned 8 cpu cores as resources on docker desktop ( please see attached image). But i suspect that all the cpus (0,1,2...7) do not share load evenly and hence the response time of my tested microservice doesn't get reduced as expected. I have also tried to allocate the cpu's via command docker run --cpuset-cpus="0-7" -p 8081:8080 myimage-docker
. For each cpu in the cpuset, i want to see it's utilization stats in terms of % cpu usage. Is there a docker command that let me see all the 8 cpu's utilization at once during the docker container run. Something like ..
cpu0 - 12.5%
cpu1 - 12.5%
cpu2 - 12.5%
cpu3 - 12.5%
cpu4 - 12.5%
cpu5 - 12.5%
cpu6 - 12.5%
cpu7 - 12.5%
Here's how you can measure how evenly load is spread among CPUs.
Use this command to get a shell inside the Moby VM:
docker run -it --rm --privileged --pid=host justincormack/nsenter1
Then run this command:
mpstat -P ALL 1 100
That will measure per-cpu usage every second for 100 seconds. Afterwards, it will display averages for each core.