Simple test tool wrk


Reprint please indicate the source
Original typesetting address Click to jump


Wrk is a very simple HTTP performance testing tool. It can also be called HTTP benchmark tool. With only one command line, you can do many basic HTTP performance tests

Simple steps


git clone  
cd wrk  


wrk -t12 -c100 -d30s -T30 
wrk -t2 -c100 -d30s http://localhost:8081/ticket/tyj/profitList/uegjVvnL-Watj-iFBA-X4lu-OHINAkqC7Cwy
  • T: thread count
  • C: number of requested connections
  • D: test time,
  • T: the default timeout is 1 second. This is a little short. I usually set it to 30 seconds

In general, the number of threads should not be too many. Two to four times the number of cores is enough. If there are too many threads, the efficiency will be reduced. Because wrk does not use the model of one thread per connection, but uses asynchronous network IO to increase the concurrency. Therefore, network communication will not block the execution of threads. This is also the reason why wrk can simulate a large number of network connections with a few threads. Now, there are many Performance tools do not use this method, but use to increase the number of threads to achieve high concurrency. So once the concurrency is set to a high level, the test machine itself will be under a lot of pressure, and the test effect will decline

The result shows

  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   354.59ms  377.09ms   1.99s    83.74%
    Req/Sec    21.07     12.79    90.00     80.37%
  6957 requests in 30.10s, 102.55MB read
  Socket errors: connect 0, read 19, write 0, timeout 117
Requests/sec:    231.11
Transfer/sec:      3.41MB
  • Latency: it can be understood as response time, with average value, standard deviation, maximum value and proportion of plus or minus one standard deviation
  • Req / sec: the number of requests completed by each thread per second, with the same average value, standard deviation, maximum value, and the proportion of plus or minus one standard deviation
  • Generally speaking, we mainly focus on the average value and the maximum value. If the standard deviation is too large, it means that the sample itself has a high degree of dispersionSystem performance fluctuates greatly.

Advanced – script call

wrk.method = "POST"  
wrk.body   = "foo=bar&baz=quux"  
wrk.headers["Content-Type"] = "application/x-www-form-urlencoded"  
wrk -t12 -c100 -d30s -T30s --script=post.lua --latency  

Reference website

Wrk — a small and lightweight HTTP performance testing tool

Recommended Today

Configure Apache to support PHP in the Apache main configuration file httpd.conf Include custom profile in

In Apache’s main configuration file / conf/ http.conf Add at the bottom Include “D:workspace_phpapache-php.conf” The file path can be any In D: workspace_ Create under PHP file apache- php.conf file Its specific content is [html] view plain copy PHP-Module setup LoadFile “D:/xampp/php/php5ts.dll” LoadModule php5_module “D:/xampp/php/php5apache2_2.dll” <FilesMatch “.php$”> SetHandler application/x-httpd-php </FilesMatch> <FilesMatch “.phps$”> SetHandler application/x-httpd-php-source </FilesMatch> […]