Skip to content

dns lookup very slow #26960

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

Closed
wencan opened this issue Aug 13, 2018 · 5 comments
Closed

dns lookup very slow #26960

wencan opened this issue Aug 13, 2018 · 5 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@wencan
Copy link

wencan commented Aug 13, 2018

go version:

go version go1.10.3 linux/amd64

go env:

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/user/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/user/Projects/Go"
GORACE=""
GOROOT="/opt/Go/current"
GOTMPDIR=""
GOTOOLDIR="/opt/Go/current/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build634905456=/tmp/go-build -gno-record-gcc-switches"

httpstat http://baidu.com
output:

Connected to 220.181.57.216:80

HTTP/1.1 200 OK
Server: Apache
Accept-Ranges: bytes
Cache-Control: max-age=86400
Content-Length: 81
Content-Type: text/html
Date: Mon, 13 Aug 2018 11:07:25 GMT
Etag: "51-47cf7e6ee8400"
Expires: Tue, 14 Aug 2018 11:07:25 GMT
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
Connection: Keep-Alive

Body discarded

   DNS Lookup   TCP Connection   Server Processing   Content Transfer
[    8194ms  |          26ms  |             28ms  |             0ms  ]
             |                |                   |                  |
    namelookup:8194ms         |                   |                  |
                        connect:8220ms            |                  |
                                      starttransfer:8248ms           |
                                                                 total:8248ms   
@agnivade
Copy link
Contributor

Looks like a dup of #21906.

Also, kindly provide the output of curl -w "status- %{http_code}, dnslookup- %{time_namelookup}" http://baidu.com -s -o /dev/null

@agnivade agnivade added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Aug 13, 2018
@wencan
Copy link
Author

wencan commented Aug 14, 2018

my dns server is a internal server.
i changed it to 8.8.8.8, go ns lookup is fast.

curl and ping always normal.
go dns lookup slow only on some internal machines.

@agnivade
Copy link
Contributor

I am going to mark it as duplicate of #21906. Please try with 1.11rc1 and comment on that issue. Thank you.

@wencan
Copy link
Author

wencan commented Aug 23, 2018

@agnivade

10.50.0.1 is my internal dns server

test1:

wencan@stretch:~$ docker run -it --dns 8.8.8.8 golang:1.11-rc-stretch /bin/bash
root@4523b2fc6b78:/go# go get -u -v  github.com/davecheney/httpstat
root@4523b2fc6b78:/go# httpstat http://baidu.com

Connected to 123.125.115.110:80

HTTP/1.1 200 OK
Server: Apache
Accept-Ranges: bytes
Cache-Control: max-age=86400
Content-Length: 81
Content-Type: text/html
Date: Thu, 23 Aug 2018 03:30:20 GMT
Etag: "51-47cf7e6ee8400"
Expires: Fri, 24 Aug 2018 03:30:20 GMT
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
Connection: Keep-Alive

Body discarded

   DNS Lookup   TCP Connection   Server Processing   Content Transfer
[      97ms  |          23ms  |             24ms  |             0ms  ]
             |                |                   |                  |
    namelookup:97ms           |                   |                  |
                        connect:121ms             |                  |
                                      starttransfer:145ms            |
                                                                 total:145ms  

test2:

wencan@stretch:~$ docker run -it --rm --dns  10.50.0.1 golang:1.11-rc-stretch /bin/bash
root@ef8fc343110e:/go# go get -u -v  github.com/davecheney/httpstat
root@ef8fc343110e:/go#  httpstat http://baidu.com

Connected to 220.181.57.216:80

HTTP/1.1 200 OK
Server: Apache
Accept-Ranges: bytes
Cache-Control: max-age=86400
Content-Length: 81
Content-Type: text/html
Date: Thu, 23 Aug 2018 03:55:15 GMT
Etag: "51-47cf7e6ee8400"
Expires: Fri, 24 Aug 2018 03:55:15 GMT
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
Connection: Keep-Alive

Body discarded

   DNS Lookup   TCP Connection   Server Processing   Content Transfer
[    8239ms  |          27ms  |             29ms  |             0ms  ]
             |                |                   |                  |
    namelookup:8239ms         |                   |                  |
                        connect:8267ms            |                  |
                                      starttransfer:8296ms           |
                                                                 total:8297ms   

test3:

wencan@stretch:~$ docker run -it --rm --dns 8.8.8.8 golang:1.10.3-stretch /bin/bash
root@33f3758a7160:/go# go get -u -v  github.com/davecheney/httpstat
root@33f3758a7160:/go#  httpstat http://baidu.com

Connected to 123.125.115.110:80

HTTP/1.1 200 OK
Server: Apache
Accept-Ranges: bytes
Cache-Control: max-age=86400
Content-Length: 81
Content-Type: text/html
Date: Thu, 23 Aug 2018 03:55:38 GMT
Etag: "51-47cf7e6ee8400"
Expires: Fri, 24 Aug 2018 03:55:38 GMT
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
Connection: Keep-Alive

Body discarded

   DNS Lookup   TCP Connection   Server Processing   Content Transfer
[      55ms  |          24ms  |             24ms  |             0ms  ]
             |                |                   |                  |
    namelookup:55ms           |                   |                  |
                        connect:79ms              |                  |
                                      starttransfer:104ms            |
                                                                 total:104ms    

test4:

wencan@stretch:~$  docker run --rm -it --dns 10.50.0.1 golang:1.10.3-stretch /bin/bash
root@740ecbb8125c:/go# go get -u -v  github.com/davecheney/httpstat
root@740ecbb8125c:/go#  httpstat http://baidu.com

Connected to 220.181.57.216:80

HTTP/1.1 200 OK
Server: Apache
Accept-Ranges: bytes
Cache-Control: max-age=86400
Content-Length: 81
Content-Type: text/html
Date: Thu, 23 Aug 2018 03:55:50 GMT
Etag: "51-47cf7e6ee8400"
Expires: Fri, 24 Aug 2018 03:55:50 GMT
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
Connection: Keep-Alive

Body discarded

   DNS Lookup   TCP Connection   Server Processing   Content Transfer
[    8289ms  |          26ms  |             28ms  |             0ms  ]
             |                |                   |                  |
    namelookup:8289ms         |                   |                  |
                        connect:8315ms            |                  |
                                      starttransfer:8344ms           |
                                                                 total:8344ms   

@agnivade
Copy link
Contributor

Please comment on #21906 with your findings.

@golang golang locked and limited conversation to collaborators Aug 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants