Benchmark Websites with CURL

From Knowledge Center
Jump to: navigation, search

Benchmarking Websites with Curl utility

$ curl -s -w '\nLookup time:\t%{time_namelookup}\nConnect time:\t%{time_connect}\nAppCon time:\t%{time_appconnect}\nRedirect time:\t%{time_redirect}\nPreXfer time:\t%{time_pretransfer}\nStartXfer time:\t%{time_starttransfer}\n\nTotal time:\t%{time_total}\n' -o /dev/null http://whatsforsale.shopping

Lookup time:    0.004
Connect time:   0.035
AppCon time:    0.000
Redirect time:  0.000
PreXfer time:   0.035
StartXfer time: 0.379

With Nginx Caching:

$ curl -s -w '\nLookup time:\t%{time_namelookup}\nConnect time:\t%{time_connect}\nAppCon time:\t%{time_appconnect}\nRedirect time:\t%{time_redirect}\nPreXfer time:\t%{time_pretransfer}\nStartXfer time:\t%{time_starttransfer}\n\nTotal time:\t%{time_total}\n' -o /dev/null obj-cache.cloud.ruanbekker.com/elasticsearch-2.jpg

Lookup time:	1.524465
Connect time:	1.707561
AppCon time:	0.000000
Redirect time:	0.000000
PreXfer time:	1.707656
StartXfer time:	1.897660

Total time:	2.451824

Now that the content is cached:

$ curl -s -w '\nLookup time:\t%{time_namelookup}\nConnect time:\t%{time_connect}\nAppCon time:\t%{time_appconnect}\nRedirect time:\t%{time_redirect}\nPreXfer time:\t%{time_pretransfer}\nStartXfer time:\t%{time_starttransfer}\n\nTotal time:\t%{time_total}\n' -o /dev/null obj-cache.cloud.ruanbekker.com/elasticsearch-2.jpg

Lookup time:	0.004441
Connect time:	0.188065
AppCon time:	0.000000
Redirect time:	0.000000
PreXfer time:	0.188160
StartXfer time:	0.381344

Total time:	0.926420

Resource:

- http://blog.pistack.co.za/building-nginx-on-alpine-image-for-docker-swarm-with-caching-enabled-config/