Last Updated: February 25, 2016
·
1.245K
· aleemb

Curl Benchmarking Script

Save this as bench.sh and chmod +x bench.sh

#!/bin/sh
curl -Lo /dev/null -skw "\n    time_namelookup:  %{time_namelookup}\n       time_connect:  %{time_connect}\n    time_appconnect:  %{time_appconnect}\n   time_pretransfer:  %{time_pretransfer}\n      time_redirect:  %{time_redirect}\n  time_starttransfer: %{time_starttransfer}\n                      -----   \n         time_total:  %{time_total}\n\n" $1

Results in:

~> ./bench.sh http:/www.example.com/


    time_namelookup:  0.005
       time_connect:  0.564
    time_appconnect:  0.000
   time_pretransfer:  0.564
      time_redirect:  0.000
  time_starttransfer: 1.500
                      -----   
         time_total:  4.540