我有一个尝试运行的节点:8.9.2-alpine图片
curl -o /dev/null -s -w 'Total: %{time_total}\n' 'https://feed.theplatform.com/' -v
通话时间为6秒。如果我在本地运行相同的卷曲,则需要0.5秒。
我发现nslookup需要一些时间,所以我跑了
RUN apk add --update --no-cache bind-tools
但是我的卷曲仍然需要6秒钟。
/ # curl -o /dev/null -s -w 'Total: %{time_total}\n' 'https://feed.theplatform.com/' -v --trace-time
10:13:54.843110 * Trying 199.27.170.188...
10:13:54.843198 * TCP_NODELAY set
10:13:54.938974 * Connected to feed.theplatform.com (199.27.170.188) port 443 (#0)
10:13:54.939222 * ALPN, offering http/1.1
10:13:54.950969 * successfully set certificate verify locations:
10:13:54.951041 * CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: none
10:13:54.951198 * TLSv1.2 (OUT), TLS handshake, Client hello (1):
10:13:54.951222 } [512 bytes data]
10:13:55.046650 * TLSv1.2 (IN), TLS handshake, Server hello (2):
10:13:55.046875 { [85 bytes data]
10:13:55.047031 * TLSv1.2 (IN), TLS handshake, Certificate (11):
10:13:55.047063 { [3984 bytes data]
10:13:55.047965 * TLSv1.2 (IN), TLS handshake, Server finished (14):
10:13:55.047990 { [4 bytes data]
10:13:55.048175 * TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
10:13:55.048197 } [262 bytes data]
10:13:55.048233 * TLSv1.2 (OUT), TLS change cipher, Client hello (1):
10:13:55.048253 } [1 bytes data]
10:13:55.048338 * TLSv1.2 (OUT), TLS handshake, Finished (20):
10:13:55.048358 } [16 bytes data]
10:13:55.147028 * TLSv1.2 (IN), TLS change cipher, Client hello (1):
10:13:55.147077 { [1 bytes data]
10:13:55.147205 * TLSv1.2 (IN), TLS handshake, Finished (20):
10:13:55.147227 { [16 bytes data]
10:13:55.147273 * SSL connection using TLSv1.2 / AES256-SHA256
10:13:55.147295 * ALPN, server did not agree to a protocol
10:13:55.147339 * Server certificate:
10:13:55.147395 * subject: C=US; ST=Washington; L=Seattle; O=thePlatform, LLC; OU=Network Operations; CN=feed.theplatform.com
10:13:55.147423 * start date: Oct 22 22:05:39 2015 GMT
10:13:55.147451 * expire date: Jan 5 22:35:38 2019 GMT
10:13:55.147495 * subjectAltName: host "feed.theplatform.com" matched cert's "feed.theplatform.com"
10:13:55.147531 * issuer: C=US; O=Entrust, Inc.; OU=See www.entrust.net/legal-terms; OU=(c) 2012 Entrust, Inc. - for authorized use only; CN=Entrust Certification Authority -L1K
10:13:55.147553 * SSL certificate verify ok.
10:13:55.147650 > GET / HTTP/1.1
10:13:55.147650 > Host: feed.theplatform.com
10:13:55.147650 > User-Agent: curl/7.60.0
10:13:55.147650 > Accept: */*
10:13:55.147650 >
10:13:55.244488 < HTTP/1.1 403 Forbidden
10:13:55.244544 < Date: Fri, 13 Jul 2018 10:13:55 GMT
10:13:55.244576 < Content-Type: text/html;charset=ISO-8859-1
10:13:55.244606 < Cache-Control: must-revalidate,no-cache,no-store
10:13:55.244637 < Content-Length: 1365
10:13:55.244668 < Connection: close
10:13:55.244699 < Server: Jetty(8.1.16.2)
10:13:55.244730 <
10:13:55.244760 { [1225 bytes data]
10:13:55.244901 * Closing connection 0
10:13:55.245043 * TLSv1.2 (OUT), TLS alert, Client hello (1):
10:13:55.245079 } [2 bytes data]
Total: 5.915162
enter code here
enter code here
如果我调用http版本,它仍然需要花费很长时间:
/ # curl -o /dev/null -s -w 'Total: %{time_total}\n' 'http://feed.theplatform.com/' -v --trace-time
10:12:29.865144 * Trying 199.27.170.188...
10:12:29.865215 * TCP_NODELAY set
10:12:29.961021 * Connected to feed.theplatform.com (199.27.170.188) port 80 (#0)
10:12:29.961119 > GET / HTTP/1.1
10:12:29.961119 > Host: feed.theplatform.com
10:12:29.961119 > User-Agent: curl/7.60.0
10:12:29.961119 > Accept: */*
10:12:29.961119 >
10:12:30.057339 < HTTP/1.1 403 Forbidden
10:12:30.057395 < Date: Fri, 13 Jul 2018 10:12:30 GMT
10:12:30.057425 < Content-Type: text/html;charset=ISO-8859-1
10:12:30.057453 < Cache-Control: must-revalidate,no-cache,no-store
10:12:30.057482 < Content-Length: 1365
10:12:30.057505 < Connection: close
10:12:30.057527 < Server: Jetty(8.1.16.2)
10:12:30.057554 <
10:12:30.057578 { [1365 bytes data]
10:12:30.057666 * Closing connection 0
Total: 5.705922
如果我使用node:8.11.3-alpine,我也会遇到同样的问题
时间显示,这是有问题的通话开始。 我该如何解决?
答案 0 :(得分:0)
我的名称服务器存在问题。 通过添加%{time_namelookup}并运行
curl -o /dev/null -s -w 'Total: %{time_total}\nTime Namelookup: %{time_namelookup}\n' 'http://feed.theplatform.com/' -v --trace-time
我得到了Time Namelookup:5.514205
我尝试将名称服务器更改为google,然后在0.5秒内得到了结果。