How do you set readily benchmark between connections using Curl
Sep 6, 2018 · 1 min read
When trying to measure your performance, could we just do it in easy way ?
Apparently, the answer is yes. There’re many references. I just referred from Stackoverflows with Curl. Curl provides many options including escaping certificate checking, calling in various HTTP methods, and carrying media files.
First, I defined the format files as follows.
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
Then, using following command measures your connection
curl -w "@format.txt" -o /dev/null -k -s http://medium.comarguments illustrated :
- -w make display format , https://curl.haxx.se/docs/manpage.html#-w
- -o write the output file, https://curl.haxx.se/docs/manpage.html#-o
- -k insecure
- -s silence
the last argument is your target. It is easy enough. BTW, you can directly assign format without designate format files as document says. Good luck to you guys.