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

Optimize "time-to-shell" for Windows containers #5

Open
amotl opened this issue Jun 10, 2022 · 1 comment
Open

Optimize "time-to-shell" for Windows containers #5

amotl opened this issue Jun 10, 2022 · 1 comment

Comments

@amotl
Copy link
Member

amotl commented Jun 10, 2022

With #4, the Windows subsystem gets actually usable. However, it currently has three speed bumps when looking at optimizing the "time-to-shell" 1.

A. Container image inspection

Before launching the container, we need to inspect its image in order to select which WDM host to use (Windows 2016, 2019, or 2022). On certain container images, we observed this can take up to three seconds when using skopeo inspect.

$ time skopeo --override-os=windows inspect --config --no-tags docker://docker.io/eclipse-temurin:18-jdk > /dev/null

real	0m3.262s
user	0m0.026s
sys	0m0.212s

We need to mitigate that speed bump, for example by caching the output of the skopeo inspect call. It will not be too difficult.

B. Container image adjustments

Currently, docker build is invoked on every invocation. Getting rid if it will save another 0.5 seconds.

C. PowerShell slowness

We are asking the community about any guidance on this matter. Does PowerShell really have such a large invocation overhead when compared to the cmd shell?

With the cmd program, it takes around 1.4 to 2.6 seconds to spawn a shell.

time racker run --rm --platform=windows/amd64 mcr.microsoft.com/windows/servercore:{ltsc2016,ltsc2019,ltsc2022} -- cmd /C exit

The powershell program takes around 3.1 to 4.7 seconds to spawn a shell.

time racker run --rm --platform=windows/amd64 mcr.microsoft.com/windows/servercore:{ltsc2016,ltsc2019,ltsc2022} -- powershell -Command exit

Footnotes

  1. The time needed to launch a container and connect your terminal to a shell inside the container.

@amotl
Copy link
Member Author

amotl commented Jun 11, 2022

Caching inquiries to upstream OCI registries is also important for another reason.

$ racker --verbose run --rm --platform=windows/amd64 winamd64/python:3.10-windowsservercore-ltsc2022 -- python -V
2022-06-11 21:13:31,035 [racker.cli        ] INFO    : Preparing runtime environment for platform windows/amd64 and image winamd64/python:3.10-windowsservercore-ltsc2022
2022-06-11 21:14:04,374 [postroj.winrunner ] ERROR   : Inquiring information about OCI image 'docker://winamd64/python:3.10-windowsservercore-ltsc2022' failed. Command 'skopeo --override-os=windows inspect --config --no-tags docker://winamd64/python:3.10-windowsservercore-ltsc2022' returned non-zero exit status 1. Reason: time="2022-06-11T21:14:04+02:00" level=fatal msg="Error parsing image name \"docker://winamd64/python:3.10-windowsservercore-ltsc2022\": reading manifest 3.10-windowsservercore-ltsc2022 in docker.io/winamd64/python: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit"

Error parsing image name "docker://winamd64/python:3.10-windowsservercore-ltsc2022": reading manifest 3.10-windowsservercore-ltsc2022 in docker.io/winamd64/python: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant