measuring webserver performance - httperf

Posted: June 7th, 2008 | Author: sofia | Filed under: open | Tags: , |

Httperf is a webserver performance tester. There are loads of performance testers out there (take a look here ) but i was up and running with httperf in no time. So here’s a quick get started guide

  1. Download the latest version from ftp://ftp.hpl.hp.com/pub/httperf/
  2. Install
    • $ tar xvzf httperf-0.9.0.tar.gz
    • $ cd httperf-0.9
    • $ ./configure
    • $ make
    • $ sudo make install

    Httperf is installed by default in /usr/local/bin/httperf. You then invoke httperf from the command line.

  3. Have a website to test (lol)
  4. Here’s a sample command
    $ httperf –server hostname –port 80 –ur /test.html –rate 150 –num-conn 27000 –num-call 1  –timeout 5
    Example: You have your site on localhost and for now just wanna test that.

    • $ httperf –server localhost –ur /about.html –num-conns 1000
      - test the page about.html in the localhost  server making 1000 concurrent connections
    • $ httperf  –-server=localhost –-wsess=12,8,2 –-rate=1 –-timeout=5
      • The –wsess sets the total number of sessions to generate, the number of calls per session, and the time (in seconds) that separates consecutive calls. If we use –wsess=12,8,2, we’re setting 12 sessions at five calls per session with two seconds between each call.
      • The –rate switch specifies the number of HTTP requests/second sent to the Web server — indicates the number of concurrent clients accessing the server. [Update] Actually when used together with –wsess it specifies the number of sessions and not of requests -> see comment by John Wilkinson below
      • The –timeout switch sets the maximum number of seconds to wait for a server response before httperf gives up. The default is forever so it’s good practice to set it just in case the server hangs (hangings your resources also). If this timeout expires, httperf considers the corresponding call to have failed.
      • The –num-conn sets how many total HTTP connections will be made during the test run - this is a cumulative number, so the higher it is, the longer the test runs
  5. Analyze the statistics printed to the console.
    There are six groups of statistics: overall results, results pertaining to the TCP connections, results for the requests that were sent, results for the replies that were received, CPU and network utilization figures, as well as a summary of the errors that occurred.
    Example printout:
    “Maximum connect burst length: 1
    Total: connections 100 requests 100 replies 100 test-duration 16.385 s

    Connection rate: 6.1 conn/s (163.8 ms/conn, <=1 concurrent connections)
    Connection time [ms]: min 135.5 avg 163.8 max 406.4 median 159.5 stddev 37.4
    Connection time [ms]: connect 19.0
    Connection length [replies/conn]: 1.000

    Request rate: 6.1 req/s (163.8 ms/req)
    Request size [B]: 64.0

    Reply rate [replies/s]: min 5.8 avg 6.1 max 6.2 stddev 0.2 (3 samples)
    Reply time [ms]: response 74.1 transfer 70.8
    Reply size [B]: header 514.0 content 15405.0 footer 1.0 (total 15920.0)
    Reply status: 1xx=0 2xx=100 3xx=0 4xx=0 5xx=0

    CPU time [s]: user 3.52 system 12.78 (user 21.5% system 78.0% total 99.5%)
    Net I/O: 95.3 KB/s (0.8*10^6 bps)

    Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0
    Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0

The connection rate, the request rate and the reply rate are the ones to look at. The better a website is performing (at the rate requested) the closer the connection and reply rate rate will be to the request rate specified in the initial command (–rate). Normally you do a series of tests, always increasing the request rate until you start to see that the reply and connection rate are no longer keeping up - that’s when you’ve hit your boundary, ie. how many requests per second your webapp is able to handle.

Also check autobench for automation of the testing process, here for an example of how httperf was used to benchmark the evolution of a project, an article from the source httperf—A Tool for Measuring Web Server Performance and finally this peepcode looks interesting.

Anyway, if i’ve missed any important information please say so in the comments.

[Update] Ted Bullock, one of the developers of httperf, was kind enough to point me to his quickstart guide, a six page long doc which has much more detailed information :=)

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • del.icio.us
  • Mixx
  • Google
  • description

8 Comments on “measuring webserver performance - httperf”

  1. #1 John Wilkinson said at 02:05 am on July 20th, 2008:

    Actually in the case of using wsess or wsesslog, –rate is the rate of sessions, not the rate of requests. With the following parameters …–wsess 80,10,0.5 –rate 5… As it turns out you’re actually specifying a request rate of 50… 5 sessions per second, 10 requests per session.

  2. #2 sofia said at 02:34 am on July 20th, 2008:

    didn’t know that. thanks for clearing it up for me :=)

  3. #3 Ted Bullock said at 21:15 pm on July 30th, 2008:

    Your build instructions are not quite correct.

    The gzipped tar file is httperf-0.9.0.tar.gz

    Also, have you checked out my quickstart guide to httperf (http://www.comlore.com/httperf)

  4. #4 sofia said at 21:41 pm on July 30th, 2008:

    Thank you :=) Typo fixed and i added a link to your pdf which really looks quite complete :=)

  5. #5 AlexM said at 12:26 pm on August 12th, 2008:

    I found your site on technorati and read a few of your other posts. Keep up the good work. I just added your RSS feed to my Google News Reader. Looking forward to reading more from you down the road!

  6. #6 Load Testing With Log Replay - igvita.com said at 15:41 pm on September 30th, 2008:

    [...] get started with httperf, check out Sofia Cardita’s great introductory guide, as well as the slides and the quickstart guide from Theodore Bullock’s presentation at [...]

  7. #7 Gp said at 02:47 am on December 24th, 2008:

    How do you pass cookie while running this tool?

  8. #8 SJS said at 14:43 pm on January 10th, 2009:

    How to give POST data to httperf? I am trying to benchmark PHP site with user inputs…


Leave a Reply