1 Onboarding of wrk as a http traffic generator in CSIT
2 -----------------------------------------------------
4 wrk is a modern HTTP benchmarking tool capable of generating significant
5 load when run on a single multi-core CPU.
7 An optional LuaJIT script can perform HTTP request generation, response
8 processing, and custom reporting.
11 wrk installation on TG node
12 '''''''''''''''''''''''''''
16 #. Check if wrk is installed on the TG node.
17 #. If not, install it.
23 # Install pre-requisites:
24 sudo apt-get install build-essential libssl-dev git -y
26 # Get the specified version:
27 wget ${WRK_DWNLD_PATH}/${WRK_TAR}
35 # Move the executable to somewhere in the PATH, e.q:
36 sudo cp wrk /usr/local/bin
42 **The traffic profile can include these items:**
44 - List of URLs - mandatory,
45 - The first CPU used to run wrk - mandatory,
46 - Number of CPUs used for wrk - mandatory,
47 - Test duration - mandatory,
48 - Number of threads - mandatory,
49 - Number of connections - mandatory,
50 - LuaJIT script - optional, defaults to no script,
51 - HTTP header - optional, defaults to no header,
52 - Latency - optional, defaults to False,
53 - Timeout - optional, defaults to wrk default.
57 List of URLs for requests. Each URL is requested in a separate instance of wrk.
65 - "http://192.168.1.1/1kB.bin"
66 - "http://192.168.1.2/1kB.bin"
67 - "http://192.168.1.3/1kB.bin"
69 **The first CPU used to run wrk**
70 The first CPU used to run wrk. The other CPUs follow this one.
79 **Number of CPUs used for wrk**
81 The number of CPUs used for wrk. The number of CPUs must be a multiplication
82 of the number of URLs.
93 The combinations of URLs and a number of CPUs create following use cases:
95 - One URL and one CPU - One instance of wrk sends one request (URL) via
97 - One URL and n CPUs - n instances of wrk send the same request (URL)
99 - n URLs and n CPUs - n instances of wrk send n requests (URL) via one
101 - n URLs and m CPUs, m = a * n - m instances of wrk send n requests
102 (URL) via one or more NICs
106 Duration of the test in seconds.
115 **Number of threads**
117 Total number of threads to use by wrk to send traffic.
126 **Number of connections**
128 Total number of HTTP connections to keep open with each thread handling
129 N = connections / threads.
136 nr-of-connections: 50
140 Path to LuaJIT script.
143 For more information see: https://github.com/wg/wrk/blob/master/SCRIPTING
149 script: "scripts/report.lua"
153 HTTP header to add to request.
154 Type: string (taken as it is) or dictionary
169 header: "Connection: close"
173 Print detailed latency statistics.
184 Record a timeout if a response is not received within this amount of time.
191 **Examples of a wrk traffic profile**
193 *Get the number of connections per second:*
195 - Use 3 CPUs to send 3 different requests via 3 NICs.
196 - The test takes 30 seconds.
197 - wrk sends traffic in one thread per CPU.
198 - There will be open max 50 connection at the same time.
199 - The header is set to 'Connection: "close"' so wrk opens separate connection
200 for each request. Then the number of requests equals to the number of
202 - Timeout for responses from the server is set to 5 seconds.
207 - "http://192.168.1.1/0B.bin"
208 - "http://192.168.1.2/0B.bin"
209 - "http://192.168.1.3/0B.bin"
213 nr-of-connections: 50
218 *Get the number of requests per second:*
220 - Use 3 CPUs to send 3 different requests via 3 NICs.
221 - The test takes 30 seconds.
222 - wrk sends traffic in one thread per CPU.
223 - There will be max 50 concurrent open connections.
228 - "http://192.168.1.1/1kB.bin"
229 - "http://192.168.1.2/1kB.bin"
230 - "http://192.168.1.3/1kB.bin"
234 nr-of-connections: 50
238 - Use 3 CPUs to send 3 different requests via 3 NICs.
239 - The test takes 30 seconds.
240 - wrk sends traffic in one thread per CPU.
241 - There will be open max 50 connection at the same time.
242 - Timeout for responses from the server is set to 5 seconds.
247 - "http://192.168.1.1/1MB.bin"
248 - "http://192.168.1.2/1MB.bin"
249 - "http://192.168.1.3/1MB.bin"
253 nr-of-connections: 50
260 **Suite setup phase**
262 CSIT framework checks if wrk is installed on the TG node. If not, or if the
263 installation is forced, it installs it on the TG node.
267 #. Make sure TRex is stopped.
268 #. Bind used TG interfaces to corresponding drivers (defined in the topology
270 #. If the wrk installation is forced:
272 - Destroy existing wrk
274 #. If the wrk installation is not forced:
276 - Check if wrk is installed.
277 - If installed, exit.
279 #. Clone wrk from git (https://github.com/wg/wrk.git)
281 #. Copy the executable to /usr/local/bin so it is in the PATH.
287 #. Read the wrk traffic profile.
288 #. Verify the profile.
289 #. Use the information from the profile to set the wrk parameters.
292 #. Evaluate and log the output.