Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hyper-V isolation uses only 2 cores. #1877

Closed
1 of 3 tasks
notanaverageman opened this issue Mar 26, 2018 · 3 comments
Closed
1 of 3 tasks

Hyper-V isolation uses only 2 cores. #1877

notanaverageman opened this issue Mar 26, 2018 · 3 comments

Comments

@notanaverageman
Copy link

Please, check https://docs.docker.com/docker-for-win/troubleshoot/.
Issues without logs and details cannot be debugged, and will be closed.

  • I have tried with the latest version of my channel (Stable or Edge)
  • I have submitted Diagnostics
  • I have included the Diagnostics ID in this Issue
  • Windows Version: Windows 10 Enterprise 1709 - 16299.309
  • Docker for Windows Version: 18.03.0-ce-rc4

Expected behavior

Container uses all the available cores.

Actual behavior

Container uses only 2 cores.

Information

The following command reports that only 2 cores are available. The cpu usage is also limited to only 2 cores.
docker run microsoft/windowsservercore WMIC CPU Get DeviceID,NumberOfCores,NumberOfLogicalProcessors

The issue can also be seen on Windows Server 2016 with hyperv isolation:
docker run --isolation=hyperv microsoft/windowsservercore WMIC CPU Get DeviceID,NumberOfCores,NumberOfLogicalProcessors

However running first command on Windows Server 2016 gives the expected output and the containers use all available cores.

@notanaverageman
Copy link
Author

Adding --cpu-count N to the command works. But, why do I have to specify the number of cpu's every time? Isn't it a more meaningful default to use all the cpu's available in host like the process isolation does? If needed one can limit the cpu usage anyways.

@rn
Copy link
Contributor

rn commented Mar 27, 2018

This is more a artefact of how containers are implemented with Hyper-V isolation. They are started in a VM an when configuring the VM the number of CPUs needs to be specified. With process isolation (only available on Windows Server) the container runs as a process which can use all cores (when it starts more threads).

Since this is not an issue specific to the Docker for Windows application, I'm closing this issue. Feel free to open an issue on https://github.com/moby/moby where some of the windows container development happens, but I suspect you may get a similar answer there.

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Jun 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants