Skip to content

Replay traffic with httperf

23 November 2010

If you need to replay your live traffic on a web server, here’s how to do it using httperf:

First you need to prepare your webserver log file, which means removing all unwanted stuff like javascript, images, css etc.

Then extract the URLs from log file with e.g. awk:

awk '{print $7}' access.log > requests.log

Translate into httperf format (requests must be separated by ASCII NUL):

tr "\n" "\0" < requests.log > httperf_wlog

Finally, feed it into httperf:

httperf --server 1.2.3.4 --wlog=B,httperf_wlog

If parameter B is set to ‘‘y’’, httperf will wrap around to the beginning of the file when reaching the end of the list (so the list of URIs is accessed repeatedly). With B set to ‘‘n’’, the test will stop no later than when reaching the end of the URI list.

Advertisements

From → web server

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: