docker run --cpuset is not having any effect
gzip
does not use multiple cores even if they are available. As a result this program is not well suited to do performance tests regarding the use of CPU cores.
Use pzip instead. see Utilizing multi core for tar+gzip/bzip compression/decompression
Also see How can I produce high CPU load on a Linux server?
conveniently the stress
tool is already available on the Docker Hub, so you can verify that the docker --cpuset-cpus
option is working correctly by running:
docker run --rm -it --cpuset-cpus="0-3" jess/stress --cpu 4
→ you will witness that all 4 cores go to 100% usage.
then by running:
docker run --rm -it --cpuset-cpus="0-1" jess/stress --cpu 4
→ you will witness that just 2 cores go to 100% usage.