Use wrk benchmark tool to stress test a website

wrk is an HTTP benchmarking tool. https://github.com/wg/wrk

-- config.lua
wrk.headers["Cookie"] = "sessionid=123; foo=bar"
response = function(status, headers, body)
    for key, value in pairs(headers) do
        if key == "Location" then
            io.write("Location header found!\n")
            io.write(key)
            io.write(":")
            io.write(value)
            io.write("\n")
            io.write("---\n")
            break
        end
    end
end
$ ./wrk \
--connections="1" \
--duration="1m" \
--script="config.lua" \
--threads="1" \
"https://www.example.com/"

Example wrk scripts: https://github.com/wg/wrk/tree/master/scripts

View this page on GitHub.
Posted .

Comments

Leave a Reply