Apr 3, 2021

How to evaluate time taken for urls using curl

  • Configure ~/.curlrc
    • Add file ~/.curlrc & add the below
    • -w "dnslookup: %{time_namelookup} | connect: %{time_connect} | appconnect: %{time_appconnect} | pretransfer: %{time_pretransfer} | starttransfer: %{time_starttransfer} | total: %{time_total} | size: %{size_download}\n"
  •  How to call urls using Curl?
    • curl -so /dev/null "https://www.site.com/test/video.mp4"
      • dnslookup: 0.013 | connect: 0.335 | appconnect: 1.090 | pretransfer: 1.090 | starttransfer: 1.666 | total: 24.770 | size: 128750670
    • curl -so /dev/null "https://cdn.site.com/test/video.mp4"
      • dnslookup: 0.013 | connect: 0.051 | appconnect: 0.311 | pretransfer: 0.311 | starttransfer: 1.287 | total: 11.556 | size: 128750670

We can observe 2nd url (CDN) takes almost half the time as the first once.


No comments:

Post a Comment