I'm trying to debug some network issues and I'd like to track down the response time for different events. For instance, the time it takes to connect to the server vs the time it took for the server to render the page (so time wget ... won't work)

I've been using wget

$ wget --spider www.google.com
Spider mode enabled. Check if remote file exists.
--2013-11-22 13:56:10--  http://www.google.com/
Resolving www.google.com...,,, ...
Connecting to www.google.com||:80... connected.    <-- Time here
HTTP request sent, awaiting response... 200 OK                  <-- Time here
Length: unspecified [text/html]
Remote file exists and could contain further links,
but recursion is disabled -- not retrieving.

Is there a way to add time stamps to the various requests?


Try ab from the apache2-utils package. it will tell you connection, processing and waiting times:

$ ab  http://www.yahoo.com/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking www.yahoo.com (be patient).....done

Server Software:        YTS/1.20.13
Server Hostname:        www.yahoo.com
Server Port:            80

Document Path:          /
Document Length:        82 bytes

Concurrency Level:      1
Time taken for tests:   0.066 seconds
Complete requests:      1
Failed requests:        0
Write errors:           0
Non-2xx responses:      1
Total transferred:      1217 bytes
HTML transferred:       82 bytes
Requests per second:    15.20 [#/sec] (mean)
Time per request:       65.796 [ms] (mean)
Time per request:       65.796 [ms] (mean, across all concurrent requests)
Transfer rate:          18.06 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        1    1   0.0      1       1
Processing:    65   65   0.0     65      65
Waiting:       62   62   0.0     62      62
Total:         66   66   0.0     66      66
  • 1
    Didn't know about this tool. Very useful. – Steve Robbins Nov 23 '13 at 0:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.