| Blocking | Webサーバーへの接続までの待ち時間。 |
| DNS Lookup | ドメインのDNSルックアップ。 |
| Connection | サーバーとの接続にかかった時間。 |
| SSL | SSLハンドシェイクにかかった時間。 |
| Sending | 送信にかかった時間。 |
| Waiting | 最初の応答を受け取るまでの待ち時間。 |
| Receiving | 応答開始から終了までの時間。 |
[DNS Lookup]に時間がかかっている場合、DNSプリフェッチを検討できる。
[Sending]や[Receiving]に時間がかかっている場合は、サーバーの物理配置の変更、CDNの検討、GZip圧縮の検討などが考えられる。
[Waiting]に時間がかかっている場合は、Webサーバー側の処理をチューニングすることを検討する必要がある
<link rel="dns-prefetch" href="http://www.example.com/" />
リクエストの順番を決定するためのスケジューリングにかかった時間
TCPコネクションを作成したあとに、リクエストを送信してレスポンスの受信が完了するまでに時間
AWS CloudFrontを使っているとなぜか失敗する。。
#http httping -sc 1 http://example.com/ #https(-l) httping -lsc 1 https://example.com/
#レスポンスのみ計測
curl -kL 'https://example.com/' -o /dev/null -w "%{time_total}" 2> /dev/null
0.543
#ステータスも表示
curl -kL 'https://examle.com/' -o /dev/null -w "%{http_code}\t%{time_total}" 2> /dev/null
200 0.543
参考curlでパフォーマンス測定 | DevelopersIO
curl https://dev.classmethod.jp -o /dev/null -s -w @- << EOF
%{http_code},
%{size_download},
%{size_upload},
%{speed_download},
%{speed_upload},
%{time_namelookup},
%{time_connect},
%{time_appconnect},
%{time_pretransfer},
%{time_starttransfer},
%{time_total}\n
EOF
curl https://dev.classmethod.jp -o /dev/null -s -w @- << EOF
size_download: %{size_download}\n
size_upload: %{size_upload}\n
speed_download: %{speed_download}\n
speed_upload: %{speed_upload}\n
time_namelookup: %{time_namelookup}\n
time_connect: %{time_connect}\n
time_appconnect: %{time_appconnect}\n
time_pretransfer: %{time_pretransfer}\n
time_starttransfer: %{time_starttransfer}\n
time_total: %{time_total}\n
EOF