影響 CURL Response 時間的因素 - Linux

Table of Contents

作業系統:CetnOS 6.9 64bit

請問一下各位 最近碰到一個問題

假設第三方api server abc.com.tw 205.123.123.111

當server使用 curl 發出request到 abc.com.tw

'有時候' 會發生response時間過久(約5s以上)

後來發現是ipv6沒有關閉. 關閉後, 速度有優化很多(5s->650ms),

但覺得還是沒有預期的快, 因為如果將curl domain換成ip 回應時間提升至(250ms),

DNS 解析時間應該不至於到 400ms ... (目前DNS 設定為 168.95.1.1)

目前ipv6已經確定關閉 lsmod | grep ipv6

不知道還有其他會影響到系統發送 curl 速度的原因嗎?

網路架構

router ----> IP分享 ----> WebServer(VM1)

PS : 如果在servre /etc/hosts 加入 abc.com.tw 205.123.123.111

回應時間也是約250ms, 所以明顯的是DNS問題

另外關閉ipv6 有一個步驟無法執行, 不知是否有影響 ...
error: "net.ipv6.conf.all.disable_ipv6" is an unknown key
error: "net.ipv6.conf.default.disable_ipv6" is an unknown key
error: "net.ipv6.conf.lo.disable_ipv6" is an unknown key

--

All Comments

Isla avatarIsla2017-08-31
請你先確定一下負責 abc.com.tw 該網域的 nameserver
Isabella avatarIsabella2017-09-03
設定是不是正確,還有這些 nameserver 本身是否都可以
正常對外提供解析運作
Valerie avatarValerie2017-09-06
然後在內網自行用 nslookup 解析測試查詢
使用 hinet dns 或是 google dns 分別解析側試看看