Mercurial
comparison third_party/wrk/README.md @ 186:8cf4ec5e2191 hg-web
Fixed merge conflict.
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Fri, 23 Jan 2026 22:38:59 -0800 |
| parents | 94705b5986b3 |
| children |
comparison
equal
deleted
inserted
replaced
| 176:fed99fc04e12 | 186:8cf4ec5e2191 |
|---|---|
| 1 # wrk - a HTTP benchmarking tool | |
| 2 | |
| 3 wrk is a modern HTTP benchmarking tool capable of generating significant | |
| 4 load when run on a single multi-core CPU. It combines a multithreaded | |
| 5 design with scalable event notification systems such as epoll and kqueue. | |
| 6 | |
| 7 An optional LuaJIT script can perform HTTP request generation, response | |
| 8 processing, and custom reporting. Details are available in SCRIPTING and | |
| 9 several examples are located in [scripts/](scripts/). | |
| 10 | |
| 11 ## Basic Usage | |
| 12 | |
| 13 wrk -t12 -c400 -d30s http://127.0.0.1:8080/index.html | |
| 14 | |
| 15 This runs a benchmark for 30 seconds, using 12 threads, and keeping | |
| 16 400 HTTP connections open. | |
| 17 | |
| 18 Output: | |
| 19 | |
| 20 Running 30s test @ http://127.0.0.1:8080/index.html | |
| 21 12 threads and 400 connections | |
| 22 Thread Stats Avg Stdev Max +/- Stdev | |
| 23 Latency 635.91us 0.89ms 12.92ms 93.69% | |
| 24 Req/Sec 56.20k 8.07k 62.00k 86.54% | |
| 25 22464657 requests in 30.00s, 17.76GB read | |
| 26 Requests/sec: 748868.53 | |
| 27 Transfer/sec: 606.33MB | |
| 28 | |
| 29 ## Command Line Options | |
| 30 | |
| 31 -c, --connections: total number of HTTP connections to keep open with | |
| 32 each thread handling N = connections/threads | |
| 33 | |
| 34 -d, --duration: duration of the test, e.g. 2s, 2m, 2h | |
| 35 | |
| 36 -t, --threads: total number of threads to use | |
| 37 | |
| 38 -s, --script: LuaJIT script, see SCRIPTING | |
| 39 | |
| 40 -H, --header: HTTP header to add to request, e.g. "User-Agent: wrk" | |
| 41 | |
| 42 --latency: print detailed latency statistics | |
| 43 | |
| 44 --timeout: record a timeout if a response is not received within | |
| 45 this amount of time. | |
| 46 | |
| 47 ## Benchmarking Tips | |
| 48 | |
| 49 The machine running wrk must have a sufficient number of ephemeral ports | |
| 50 available and closed sockets should be recycled quickly. To handle the | |
| 51 initial connection burst the server's listen(2) backlog should be greater | |
| 52 than the number of concurrent connections being tested. | |
| 53 | |
| 54 A user script that only changes the HTTP method, path, adds headers or | |
| 55 a body, will have no performance impact. Per-request actions, particularly | |
| 56 building a new HTTP request, and use of response() will necessarily reduce | |
| 57 the amount of load that can be generated. | |
| 58 | |
| 59 ## Acknowledgements | |
| 60 | |
| 61 wrk contains code from a number of open source projects including the | |
| 62 'ae' event loop from redis, the nginx/joyent/node.js 'http-parser', | |
| 63 and Mike Pall's LuaJIT. Please consult the NOTICE file for licensing | |
| 64 details. | |
| 65 | |
| 66 ## Cryptography Notice | |
| 67 | |
| 68 This distribution includes cryptographic software. The country in | |
| 69 which you currently reside may have restrictions on the import, | |
| 70 possession, use, and/or re-export to another country, of encryption | |
| 71 software. BEFORE using any encryption software, please check your | |
| 72 country's laws, regulations and policies concerning the import, | |
| 73 possession, or use, and re-export of encryption software, to see if | |
| 74 this is permitted. See <http://www.wassenaar.org/> for more | |
| 75 information. | |
| 76 | |
| 77 The U.S. Government Department of Commerce, Bureau of Industry and | |
| 78 Security (BIS), has classified this software as Export Commodity | |
| 79 Control Number (ECCN) 5D002.C.1, which includes information security | |
| 80 software using or performing cryptographic functions with symmetric | |
| 81 algorithms. The form and manner of this distribution makes it | |
| 82 eligible for export under the License Exception ENC Technology | |
| 83 Software Unrestricted (TSU) exception (see the BIS Export | |
| 84 Administration Regulations, Section 740.13) for both object code and | |
| 85 source code. |