Last active
January 16, 2023 03:34
-
-
Save adamkaplan/adf15f0d622f4932f4af to your computer and use it in GitHub Desktop.
Use Curl to identify bottlenecks in your service layers.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\n | |
Size: %{size_download}\n | |
DNS: %{time_namelookup}\n | |
Connect: %{time_connect}\n | |
SSL: %{time_appconnect}\n | |
Transfer: %{time_starttransfer}\n | |
Total: %{time_total}\n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SSL request to hostname that is not in DNS | |
> curl -o /dev/null -w @curlformat https://beta.finance.yahoo.com | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 255k 0 255k 0 0 233k 0 --:--:-- 0:00:01 --:--:-- 233k | |
Size: 261255 | |
DNS: 0.522 | |
Connect: 0.536 | |
SSL: 0.667 | |
Transfer: 0.772 | |
Total: 1.094 | |
# Repeat another 2 requests to the same host: DNS is now cached, saving 0.5 seconds. | |
# The final request re-uses the already open connection that Curl is holding, making | |
# DNS lookup, Connection time, and SSL handshake time all 0. | |
> curl -o /dev/null -w @../curlformat https://beta.finance.yahoo.com -o /dev/null https://beta.finance.yahoo.com | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 255k 0 255k 0 0 108k 0 --:--:-- 0:00:02 --:--:-- 109k | |
Size: 261238 | |
DNS: 0.005 | |
Connect: 0.086 | |
SSL: 0.230 | |
Transfer: 1.930 | |
Total: 2.341 | |
100 255k 0 255k 0 0 495k 0 --:--:-- --:--:-- --:--:-- 1048k | |
Size: 261255 | |
DNS: 0.000 | |
Connect: 0.000 <-- connection pool - 80ms connect time already completed above | |
SSL: 0.000 <-- connection pool - 140ms SSL handshake already completed above | |
Transfer: 0.064 | |
Total: 0.515 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
curl -o /dev/null -w @curlformat https://beta.finance.yahoo.com
gave me aWarning: Failed to read curlformat
.curlformat.txt
works.