Skip to content

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

Open
@amotl

Description

@amotl

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions