几个月以来,我们在Uber估算API上面临大量超时。我们使用curl发出请求,这是超时时我的测试服务器上输出的详细输出
curl -v \
-H 'Authorization: Token [my token]' \
-H 'Accept-Language: fr_FR' \
-H 'Content-Type: application/json' \
'https://api.uber.com/v1.2/estimates/price? start_latitude=48.8676689&start_longitude=2.3677804&end_latitude=48.8791163&end_longitude=2.3560725'
* Trying 104.36.195.168...
当卷曲停止时,我尝试同时在443端口上执行nc
nc -vz 104.36.195.157 443
也没有回应
几秒钟后,相同的nc命令响应成功,但是curl调用仍然停止。
几分钟后,curl将超时并重试,最终将在这里工作,即curl输出
* Trying 104.36.194.191...
* TCP_NODELAY set
* connect to 104.36.194.191 port 443 failed: Connection timed out
* Trying 104.36.195.168...
* TCP_NODELAY set
* After 85223ms connect time, move on!
* connect to 104.36.195.168 port 443 failed: Connection timed out
* Trying 104.36.195.165...
* TCP_NODELAY set
* Connected to api.uber.com (104.36.195.165) port 443 (#0)
curl成功连接后,我从API得到响应。
有时curl调用将直接起作用并响应正确的API结果。
此外,当我ping api.uber.com时,有时没有响应
$ dig api.uber.com
; <<>> DiG 9.11.3-1ubuntu1.3-Ubuntu <<>> api.uber.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12152
;; flags: qr rd ra; QUERY: 1, ANSWER: 7, AUTHORITY: 0, ADDITIONAL:
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;api.uber.com. IN A
;; ANSWER SECTION:
api.uber.com. 60 IN CNAME frontends.uber.com.
frontends.uber.com. 59 IN CNAME frontends-dca1.uber.com.
frontends-dca1.uber.com. 8 IN A 104.36.195.158
frontends-dca1.uber.com. 8 IN A 104.36.194.159
frontends-dca1.uber.com. 8 IN A 104.36.194.134
frontends-dca1.uber.com. 8 IN A 104.36.195.165
frontends-dca1.uber.com. 8 IN A 104.36.195.162
;; Query time: 44 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Thu Jan 17 12:33:30 CET 2019
;; MSG SIZE rcvd: 174
$ ping 104.36.195.158
PING 104.36.195.158 (104.36.195.158) 56(84) bytes of data.
^C
--- 104.36.195.158 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2047ms
$ ping 104.36.194.159
PING 104.36.194.159 (104.36.194.159) 56(84) bytes of data.
64 bytes from 104.36.194.159: icmp_seq=1 ttl=48 time=86.0 ms
64 bytes from 104.36.194.159: icmp_seq=2 ttl=48 time=85.6 ms
64 bytes from 104.36.194.159: icmp_seq=3 ttl=48 time=85.6 ms
^C
--- 104.36.194.159 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 85.639/85.772/86.031/0.183 ms
我的测试服务器是AWS EC2上的Ubuntu 18。 我试图在本地环境(Mint 18.3 Sylvia Ubuntu 16.04)上重现该问题,但它始终可以正常工作!
当测试服务器在Ubuntu 16.04上时,我们似乎也没有问题。我当前的测试环境有问题吗?
有人有同样的行为吗?
感谢您的时间!
答案 0 :(得分:0)
几天前,问题解决了,我没有采取任何行动。