Using Analysis.cgi to Find A Bottleneck

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

  • DNS lookup time

  • Connection setup time

  • Server silence

  • Transmission time

  • Connection close time.

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.

Sample output graph for analysis.cgi

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 ...

Get Webmaster in a Nutshell, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.