Capture Time To First Byte using curl
Working with websites is equivalent to non-ending website testing. Checking the speed of the site itself is not a new thing to check when doing performance diagnostics. And I found out that curl can calculate the speed of a website, from the initial connection time, to the time the first byte is downloaded, up to the total time the site has finished loading.
Here is a sample command using curl:
curl -o /dev/null -w "Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total} \n" http://inserturl.here
This command will output this:
[root@rai01 ~]# curl -o /dev/null -w "Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total} \n" http://pinoytux.com
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
Connect: 0.268 TTFB: 1.528 Total time: 1.528
Looks like my website is fast ![]()
The first data is the Connect time, which means this is how long it took for the curl to connect to the website.
Connect: 0.268
The second data is time when the first byte was received, Time To First Byte (TTFB).
TTFB: 1.528
The last data is the total time for the site to finish loading.
Total time: 1.528
You can also turn off the progress bar by adding the -s switch to the command.
From: http://www.unquietdesperation.com/2009/03/19/time-to-first-byte-with-curl/
Related Posts
1 Comment to “Capture Time To First Byte using curl”
Post comment
Search PinoyTux
Subscribe to Email Feeds
Blog Lounge
Popular Posts
Recent Posts
- “Cannot retrieve repository metadata” error on RHEL 5.7
- Test GSM Modem Using minicom
- Graphene: The Super Supercapacitor
Recent Comments
- Akira on Cebu Pacific Airlines is Evil!
- Rai on Tip: How to Use watch Command
- Rai on Cebu Pacific Airlines is Evil!
- Manas Savkoor on Tip: How to Use watch Command
- Jacky on Tip: Hiding Files Inside An Image in Linux








trying this out mamaya
Mabuhay ang Open source sa ‘Pinas!
– Featured your blog at PhilippineBloggers.blogspot.com
PhilippineBloggers´s last blog post is (Technology Blog) PinoyTux