schlink

How to replay live traffic with httperf

First, use your Apache/lighttpd/nginx logfile to get all the application traffic. If you don’t use an asset host, filter out any unwanted requests (images, javascripts, etc.),

Parse the logfile for the request uris:

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

Get the requests into the stupid format httperf needs

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

Now you can fire up httperf:

httperf --server localhost --port 3000 --wlog=n,requests_httperf --num-conns=10000

this does sequential requests (num-conns should be the amount of requests in your logfile), which is very useful for finding memory leaks. You can probably play with the —rate parameter to do a stress test.