I am using Docker Desktop on Windows 11 with WSL 2. However, even when specifying the –cpus parameter in the docker run command, the CPU usage on my computer is only around 300% (16 cores). According to Microsoft’s official information, this is due to Hyper-V directly scheduling it, and Docker can only use as much as it is given. How can I remove this limitation and allow the system to give all resources to Docker, letting me control how much to use?
Since there are other tasks running on the computer simultaneously, switching to a Linux system is not a viable option.
I have tried using the –cpus related parameters, but it doesn’t seem to help. According to my understanding, no matter what changes I make in Docker, it will still be subject to the scheduling of Hyper-V.
张益铭 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.