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
Remove Windows-specific DefaultHTTPHost (127.0.0.1 instead of localhost) #41616
Comments
I'd like to get rid of that ugly workaround to cleanup and simplify the code; so perhaps someone who's running on Windows could check? @olljanat @StefanScherer 🤗 |
@thaJeztah I've tested it on a Windows Server 2019 and a Docker Engine - Enterprise 19.03.12 configured like this: {
"hosts": [
"tcp://localhost:2375",
"npipe://"
],
"experimental": false
} Running Docker CLI with localhost:2375 connection is indeed a bit slower, but not a whole second:
|
Now I ran a comparison with this insecure setting ( {
"hosts": [
"tcp://0.0.0.0:2375",
"npipe://"
],
"experimental": false
} and then both Docker CLI commands are both fast.
But anyway, the default on Windows is the named pipe and not using a TCP port. So I don't really would bother if it's a bit slower. |
And a final test with TLS activated when someone wants to use TCP connection: {
"hosts": [
"tcp://0.0.0.0:2376",
"npipe://"
],
"tlscert": "C:\\ProgramData\\docker\\certs.d\\server-cert.pem",
"experimental": false,
"tlsverify": true,
"tlskey": "C:\\ProgramData\\docker\\certs.d\\server-key.pem",
"tlscacert": "C:\\ProgramData\\docker\\certs.d\\ca.pem"
} Both commands are fast:
|
Thanks for checking!
Interesting, so in that case it's still 4 times as slow as the IP-address (and if I look at the description, that same delay would happen twice on a
I guess by setting
Correct; looking at when that default is used, and looks to be in Line 80 in c2cc352
Which looks to use that address if someone specified the scheme without any additional info ( Also looking at the original description;
perhaps @daschott, @madhanrm, or @dineshgovindasamy knows if this is a known issue and/or if there's a ticket inside Microsoft tracking this problem. |
I suspect that it is because Windows prefer IPv6 over IPv4 so it will first try connect to |
Pull request #17777 added a workaround for a performance issue identified in Windows TP4 (technical preview for Windows Server 2016 "RS1").
When connecting to the docker API using TCP, there was a 2-second delay when using
localhost
, which did not occur when using the IP address (127.0.0.1
) instead;A long description can be found as a comment in source:
moby/opts/opts_windows.go
Line 3 in 8988448
We should investigate if this problem is still there, or if it's safe to remove the workaround.
The text was updated successfully, but these errors were encountered: