来自 php 的慢卷曲,其他

sav*_*guy 2 networking php centos curl

最近切换到不同的服务器,一些 php 文件使用 curl 并且最初似乎运行良好但不再那么多了。这是 google.com 的 curl_getinfo

array(20) { 
    ["url"]=> string(22) "http://www.google.com/" 
    ["content_type"]=>  string(24) "text/html; charset=UTF-8" 
    ["http_code"]=>  int(200) 
    ["header_size"]=>  int(504) 
    ["request_size"]=>  int(1136) 
    ["filetime"]=>  int(-1) 
    ["ssl_verify_result"]=>  int(0) 
    ["redirect_count"]=>  int(1)
    ["total_time"]=>  float(20.098232) 
    ["namelookup_time"]=>  float(0.006034) 
    ["connect_time"]=>  float(0.020963) 
    ["pretransfer_time"]=>  float(0.020999) 
    ["size_upload"]=>  float(0) 
    ["size_download"]=>  float(5481) 
    ["speed_download"]=>  float(272) 
    ["speed_upload"]=>  float(0) 
    ["download_content_length"]=>  float(5481) 
    ["upload_content_length"]=>  float(0) 
    ["starttransfer_time"]=>  float(0.047948) 
    ["redirect_time"]=>  float(20.035229) 
}
Run Code Online (Sandbox Code Playgroud)

有 1 次重定向,不知何故需要 20 秒,基本上是我等待的时间的 100%。

还有其他一些奇怪的延迟,登录 ssh 需要 20-30 秒才能在密码后进行身份验证/拒绝,而这曾经是即时的。

有任何想法吗?

sav*_*guy 5

问题是 IPv6 - 由于某种原因,DNS 需要 20 秒才能回退到 IPv4。删除 IPv6 支持解决了这个问题。