How to Use Wget to Determine Performance Issues

Calculating Tcp Connect Time and http Response Time with wget

The Problem

A client of mine complained about intermittent performance issues with a web based application; upon learning that there were multiple file systems involved, I thought that Wget might help.

What is Wget?

Wget is a free command line tool (http://gnuwin32.sourceforge.net/packages/wget.htm) used to retrieve files from the World Wide Web using HTTP and FTP. My goal was to document the latency and throughput of each file system.

Best case scenario would be that Wget would identify some performance issues. Unfortunately, that will be tough since we do not have any previous baselines to compare it to. Therefore, the main goal for me would be to use Wget to establish a baseline on throughput and latency.

How do I Proceed?

The methodology behind this is to capture the traffic generated with Wget and then analyze the packets along with the wget results. Since we are only transferring one file over three filesystems, the payload isn’t important and I can use packet slicing to reduce the file size. With packet slicing, the trace file is reduced from almost 100 MB to approximately 16 MB. The filename naming convention was simple; the file size with a number identifying the filesystem.

Keep in mind that file transfers are based on Bytes, not bits. For example 100 Mb/s is equivalent to 12.5 MB/s.

Wget results

5 tests were performed, the highest and lowest times were removed, and the remaining 3 were averaged.

File Throughput Time
95MB1 5.77 MB/s 18 seconds
95MB2 9.52 MB/s 11 seconds
95MB3 9.7 MB/s 10 seconds

 

Results

From the initial Wget results, you can see 95MB1 is the slowest and conversely took the longest. Now we can look at the trace files to see if the packets back up what wget reported.

The first thing I measured was the TCP connect time (this is basically the time between the SYN and SYN ACK).

The second thing that I measured is the time between the HTTP Get and the first data packet.

Response Time Results

5 tests were performed, the highest and lowest times were removed and the remaining 3 were averaged.

File SYN HTTP
95MB1 123 ms 1.02 seconds
95MB2 66 ms 27 ms
95MB3 76 ms 38 ms

 

Results

The packet analysis confirmed that the Wget results with 95MB1 have the slowest TCP connect time and HTTP response time.

I hope this introduction to Wget helps you out with your day to day troubleshooting!

Request a NetBeez demo