chrome reques 分析

2017051009:39
 

chrome






Queued at 0



Started at 11.91ms

瀏覽器得到要發出這個請求的指令,到請求可以發出的等待時間,
一般是代理協商、以及等待可複用的TCP連接釋放的時間
不包括DNS查詢、建立TCP連接等時間等



Queueing  11.19ms


Stalled  5.27ms


DNS Lookup 132.47ms
域名解析花費的時間  (132.47ms 太高了,大致觀察大部分略有的網站多在 20ms以下) **文後查詢工具


Initaial connection  61.54ms


SSL   37.00ms


Request sent  0.22ms
瀏覽器發送本次請求的第一個bit,到最後一個bit。


Waiting (TTFB)   161.05ms
發出請求後(request 發出結束),到收到回應第一個 byte 所花費的時間 (Time To First Byte)



Content Download  6.79ms
下載完整網頁(或圖片) 的時間


https://developers.google.com/web/tools/chrome-devtools/network-performance/reference#timing

Timing breakdown phases explained

Here's more information about each of the phases you may see in the Timing tab:

  • Queueing. The browser queues requests when:
    • There are higher priority requests.
    • There are already six TCP connections open for this origin, which is the limit. Applies to HTTP/1.0 and HTTP/1.1 only.
    • The browser is briefly allocating space in the disk cache
  • Stalled. The request could be stalled for any of the reasons described in Queueing.
  • DNS Lookup. The browser is resolving the request's IP address.
  • Proxy negotiation. The browser is negotiating the request with a proxy server.
  • Request sent. The request is being sent.
  • ServiceWorker Preparation. The browser is starting up the service worker.
  • Request to ServiceWorker. The request is being sent to the service worker.
  • Waiting (TTFB). The browser is waiting for the first byte of a response. TTFB stands for Time To First Byte. This timing includes 1 round trip of latency and the time the server took to prepare the response.
  • Content Download. The browser is receiving the response.
  • Receiving Push. The browser is receiving data for this response via HTTP/2 Server Push.
  • Reading Push. The browser is reading the local data previously receieved.








firefox 54





被阻擋 (Blocking):
每個瀏覽器有並發連接數量的上限(例如 Firefox 對每個 host 限制6個連接)
如果當前建立的連接數已經超過上限,那麼其餘該請求會被阻塞,等待新的可以用的連接。

  -->這裡有個問題,即使只有一個 Request (只瀏覽一張圖片) 有時也會有 【Blocking 時間】 why ??


DNS解析 (DNS Lookup):
不解釋了


連接 (Connecting):
三次握手建立TCP鏈接的時間。如果是HTTPS的話,再加上SSL鏈接的時間


傳送 (Sending):
瀏覽器發送本次請求的第一個bit,到最後一個bit。


等待 (Waiting / TTFB):
從發送結束起,到收到server傳回的第一個bit。


接收 (Receiving):
從收到server 返回的第一個bit,收到到最後一個bit 的時間。






 

httpstat

https://github.com/reorx/httpstat

這個工具是以 curl 來測試瀏覽網頁,各階段花費的時間

例如