benchmarking shouldnt be har-wrk
This is a dead-simple utility for using the wrk HTTP benchmarking tool and HAR files to make the same requests to your server that your browser does.
It generates a Lua script for wrk that continuously makes a series of requests you choose from a HAR file.
Install requirements: Node.js and wrk.
# on a mac
brew install node
brew install wrk
Clone this repo and install dependencies:
git clone [email protected]:loganlinn/har-wrk.git
cd har-wrk
npm install
Using your browser of choice (or some other HAR tool), capture a set of requests that you want to benchmark into a HAR file.
Update the function that determines whether request of a HAR entry should be included in the output.
At a minimum, you'll want to filter to the requests made to the server you'll be
benchmarking by looking at entry.request.url
.
The harToWrkScript.js
takes HAR file on STDIN and writes a Lua script to
STDOUT.
harToWrkScript.js < input.har > script.lua
Take a peek at the generated script to make sure it has the requests you want to benchmark.
Run wrk
with the script and specify a base URL. See wrk --help
for available
options.
wrk -s script.lua http://localhost:8080