Replay traffic with httperf
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.
Advertisement