Book HomeWebmaster in a Nutshell, 3rd EditionSearch this book

20.5. Using Analysis.cgi to Find A Bottleneck

A simple first step in diagnosing a performance problem is to break down performance into five categories:

These steps always happen in this order.

A tool that automatically times each of these 5 steps and generates a graph of the results (with advice) is analysis.cgi, which you can run from http://patrick.net. Simply enter a URL and it will try to graph the breakdown of these components for that URL. Figure 20-1 shows an example output graph.

Figure 20-1

Figure 20-1. Sample output graph for analysis.cgi

The advice for http://patrick.net is as follows:

advice for http://patrick.net/

DNS

I spent a cumulative 0.4052 seconds resolving hostnames. No problem with DNS.

network

It took a cumulative total of 0.0650 seconds to set up the connections to 
download your content.  The average time to connect was 0.0325 seconds.  The 
latency to make a connection to your site was OK.  I spent 0.0012 seconds 
closing the socket.

server

There was a cumulative 0.1334 seconds of server silence.  The average period 
of server silence was 0.0667 seconds.  Your server is using HTTP 1.1, which 
has better performance than HTTP 1.0. Good.

content

Your content was a total of 4984 bytes, including headers.  It would take at 
least 0.7120 seconds to download the content over a 56 Kbps modem.  It would 
take at least 0.0791 seconds to download the content over a 500 Kbps DSL line.

Your content size is well suited for surfing with a 56K modem: less than 3 
seconds.  Here are URLs of the 2 elements on the page, with server response 
headers:

    http://patrick.net:80/webpt_sm.gif
    HTTP/1.1 200 OK 
    Date: Mon, 23 Apr 2001 19:14:29 GMT
    Server: Apache/1.3.9 (Unix) 
    Last-Modified: Tue, 07 Nov 2000 05:56:29 GMT 
    ETag: "11aaa93-865-3a07998d"
    Accept-Ranges: bytes 
    Content-Length: 2149 
    Connection: close 
    Content-Type: image/gif
   
http://patrick.net/

HTTP/1.1 200 OK
Date: Mon, 23 Apr 2001 19:14:29 GMT
Server: Apache/1.3.9 (Unix)
Last-Modified: Sat, 03 Mar 2001 22:56:46 GMT
ETag: "11aaa81-929-3aa176ae"
Accept-Ranges: bytes
Content-Length: 2345
Connection: close
Content-Type: text/html

Multiple copies of the same element are counted only once, on the assumption 
that the browser is smart enough to reuse them.

summary

The total is 1.3168 seconds.     
The bottleneck was transmission.

We are told that the bottleneck was transmission time. The best way to make this page faster is to get it from a faster connection. A total content size of 4984 bytes is already small, so there's not much room for improvement there. There is little point in making the servers faster in this case because the potential gain from increased server speed is so small.

Here are some general guidelines for the five possible bottlenecks:



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.