从PHP缓慢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) } 

有1redirect,这是不知何故花了20秒,基本上100%的时间,我等待。

还有其他一些奇怪的延迟,login到ssh需要20-30秒才能在密码之后进行身份validation/拒绝,而且以前是瞬间的。

有任何想法吗?

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