This is the archived Fall 2013 version of the course.
For the most recent version, see http://rust-class.org/class-15-benchmarking.html.

Class 15: Benchmarking

Action Items

Problem Set 3 is due Monday, 28 October.

Everyone should have received an email with their midterm results (and other recorded grades so far). If you didn't get it, send me email ([email protected]). (It seems Google blocks these emails, so don't be shy if you didn't get it.)

Bandwidth

What determines the bandwidth between my laptop and Busselton's web server?

What should we do to improve bandwidth on the Internet?

Midterm Questions

If you have very high confidence in your code and programming infrastructure, how many processes should your web browser have?

If you have very high confidence in your code and programming infrastructure, how many tasks should your web browser (programmed in Rust) have?

How can you tell if a problem is due to a hardware or software failure?

How many uncles does Donald Duck have?

Benchmarking

Installing httperf

These steps should work to install httperf:

> wget https://httperf.googlecode.com/files/httperf-0.9.0.tar.gz
> tar xfvz httperf-0.9.0.tar.gz
> cd httperf-0.9.0
> ./configure
> make
> sudo make install

You may get lots of warnings when you make since the httperf code is quite old and uses many deprecated SSL features (but it should still work even with the warnings).

Using httperf

Send one request:

> httperf --hog --server=localhost --port=4414

Send one request:

> httperf --hog --server=localhost --port=4414 --num-conns=1000 --rate=10

Weilin's Benchmark

Run these commands (in the directory where your server runs) to generate lots of variable-sized files:

dd if=/dev/urandom of=5K.bin bs=5K count=1
dd if=/dev/urandom of=5M.bin bs=5M count=1
dd if=/dev/urandom of=10M.bin bs=10M count=1
dd if=/dev/urandom of=20M.bin bs=20M count=1
dd if=/dev/urandom of=40M.bin bs=40M count=1
dd if=/dev/urandom of=80M.bin bs=80M count=1
dd if=/dev/urandom of=512M.bin bs=512M count=1

Get the list of test URLs:

> wget http://www.cs.virginia.edu/~wx4ed/cs4414/ps3/zhtta-test-urls.txt
> tr "\n" "\0" < zhtta-test-urls.txt > zhtta-test-urls.httperf

Then, use this to test benchmark your server:

httperf --server localhost --port 4414 --rate 60 --num-conns 60 --wlog=y,./zhtta-test-urls.httperf

You will want to try different benchmarks and parameters, but this should be a good starting point to see if you are improving the server's performance. Make sure to consider both the total test duration and the average response time.