wrk is a stress testing tool written in c language

But ubuntu's software repository does not include wrk, we need to compile and install it ourselves

Installation tutorial

Install the necessary dependencies first

sudo apt install build-essential libssl-dev git unzip

Pull source code from github

git clone git@github.com:wg/wrk.git

You can also use a mirror of gitee

git clone git@gitee.com:ponponon/wrk.git

Compile the source code with make

cd wrk
make
# 把生成的wrk移到一个PATH目录下面, 比如
sudo cp wrk /usr/local/bin
Multithreaded compilation can be used to speed things up
make -j8 , 8 means 8 threads are compiled together

Use the tutorial

Test nginx with wrk

─➤  ./wrk http://192.168.31.203                             
Running 10s test @ http://192.168.31.203
  2 threads and 10 connections

  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   657.87us  761.70us  19.66ms   97.90%
    Req/Sec     8.48k   743.41     9.74k    83.00%
  168665 requests in 10.00s, 138.16MB read
Requests/sec:  16865.61
Transfer/sec:     13.82MB

Test gunicorn with wrk

─➤  ./wrk http://192.168.31.203:63000/upload/                     
Running 10s test @ http://192.168.31.203:63000/upload/
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    10.91ms    7.41ms  93.90ms   79.23%
    Req/Sec   486.49     92.10   797.00     64.50%
  9692 requests in 10.01s, 3.47MB read
  Non-2xx or 3xx responses: 9692
Requests/sec:    968.38
Transfer/sec:    354.63KB

Reference article:
How does increase the Github download speed to 2MB/s?
http performance test wrk tutorial


universe_king
3.4k 声望680 粉丝