Skip to content

Webserver benchmark with wrk

What is wrk ?

wrk is a modern HTTP benchmarking tool capable of generating significant load when run on a single multi-core CPU. It combines a multithreaded design with scalable event notification systems such as epoll and kqueue.

An optional LuaJIT script can perform HTTP request generation, response processing, and custom reporting.

You can get wrk from official git page:

Let’s install from ports on FreeBSD

[root@vm01 ~]# make install clean -C /usr/ports/benchmarks/wrk

Available options

    -c, --connections #  Connections to keep open   
    -d, --duration    #  Duration of test           
    -t, --threads     #  Number of threads to use   
    -s, --script      #  Load Lua script file       
    -H, --header      #  Add header to request      
        --latency     #  Print latency statistics   
        --timeout     #  Socket/request timeout     
    -v, --version     #  Print version details

A quick test

[root@vm01 ~]# wrk -t4 -c200 -d30s 
Running 30s test @
  4 threads and 200 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.28s   306.99ms   1.82s    65.73%
    Req/Sec    35.70     21.72   171.00     70.49%
  4047 requests in 30.11s, 49.32MB read
Requests/sec:    134.39
Transfer/sec:      1.64MB
Published inBenchmarksFreeBSDUnix