Domain-Name-System

來自 Google 公共 DNS 的記憶體響應時間很慢

  • September 22, 2013

我注意到來自Google Public DNS 的非常奇怪但一致的性能行為8.8.8.8。即使記憶體了 DNS 記錄,響應時間也在 20 的範圍內20-30ms,這似乎很高。當我切換到O​​penDNS時,記憶體的響應時間下降到1ms. 不用說,只是將所有伺服器都切換到 O​​penDNS。任何人都可以從 Google 公共 DNS 中解釋這種糟糕的性能行為嗎?

以下是每個測試案例的dig輸出:

Google公共 DNS

未記憶體(389 毫秒)

➜  ~  dig @8.8.8.8 commando.io

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6_4.6 <<>> @8.8.8.8 commando.io
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 655
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;commando.io.       IN  A

;; ANSWER SECTION:
commando.io.        300 IN  A   192.241.225.51

;; Query time: 389 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Sun Sep 22 12:08:37 2013
;; MSG SIZE  rcvd: 45

記憶體(24 毫秒)

➜  ~  dig @8.8.8.8 commando.io

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6_4.6 <<>> @8.8.8.8 commando.io
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55425
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;commando.io.           IN  A

;; ANSWER SECTION:
commando.io.        295 IN  A   192.241.225.51

;; Query time: 24 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Sun Sep 22 12:08:42 2013
;; MSG SIZE  rcvd: 45

開放式DNS

未記憶體(46 毫秒)

➜  ~  dig commando.io 

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6_4.6 <<>> commando.io
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 49578
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;commando.io.       IN  A

;; ANSWER SECTION:
commando.io.        300 IN  A   192.241.225.51

;; Query time: 46 msec
;; SERVER: 208.67.222.222#53(208.67.222.222)
;; WHEN: Sun Sep 22 12:09:43 2013
;; MSG SIZE  rcvd: 45

記憶體(1ms)

➜  ~  dig commando.io

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6_4.6 <<>> commando.io
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42532
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;commando.io.       IN  A

;; ANSWER SECTION:
commando.io.        273 IN  A   192.241.225.51

;; Query time: 1 msec
;; SERVER: 208.67.222.222#53(208.67.222.222)
;; WHEN: Sun Sep 22 12:10:10 2013
;; MSG SIZE  rcvd: 45

這可能與鄰近性有關——1ms 的響應時間表明從路由的角度來看,您所訪問的 OpenDNS 伺服器非常靠近您的系統。

DNS 查詢時間與原始往返時間 (ping) 相比如何?

引用自:https://serverfault.com/questions/540848