O'Reilly logo

Web Performance Tuning, 2nd Edition by Patrick Killelea

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Kinked Cable

Monitoring of a web site from the same LAN reveals that static pages are either served instantly, or after a fixed delay. The monitoring graph in Figure 9-4 has horizontal striations as a result.

Some pages delivered with a fixed delay

Figure 9-4. Some pages delivered with a fixed delay

Since the web server is on a Solaris machine, we use the snoop command to see what is going on at a packet level while hitting the web server. We use the -t d option to print time differentials between packets. The open source tcpdump command would also work here.

# snoop -t d server port 80

Here is a shell script that grabs a page with the Perl LWP library’s GET command and simply redirects standard output to /dev/null, instead of printing out the time it took to get the page. Note that /bin/time writes to standard error.

#!/bin/bash
while true
    do
    /bin/time GET http://server/file.html 1>/dev/null
    sleep 1
done

We ran this and just watched the page latency for a while. When we noticed that a particular response was slow, we examined the trace for that request. You have to know a little bit about TCP to make sense of these traces, but the basic idea is that each line of the trace shows one packet. Here is an example trace, with seconds between packets as the first column:

0.65715 client -> server TCP D=80 S=64474 Syn Seq=3316330059 Len=0 Win=8760 0.00007 server -> client TCP D=64474 S=80 Syn Ack=3316330060 Seq=956551078 Len=0 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required