CSIT-1197: Add Comparison Across Testbeds to the Report
[csit.git] / docs / report / introduction / methodology.rst
1 Performance Test Methodology
2 ============================
3
4 Throughput
5 ----------
6
7 Packet and bandwidth throughput are measured in accordance with
8 :rfc:`2544`, using FD.io CSIT Multiple Loss Ratio search (MLRsearch), an
9 optimized binary search algorithm, that measures SUT/DUT throughput at
10 different Packet Loss Ratio (PLR) values.
11
12 Following MLRsearch values are measured across a range of L2 frame sizes
13 and reported:
14
15 - **Non Drop Rate (NDR)**: packet and bandwidth throughput at PLR=0%.
16
17   - **Aggregate packet rate**: NDR_LOWER <bi-directional packet rate>
18     pps.
19   - **Aggregate bandwidth rate**: NDR_LOWER <bi-directional bandwidth
20     rate> Gbps.
21
22 - **Partial Drop Rate (PDR)**: packet and bandwidth throughput at
23   PLR=0.5%.
24
25   - **Aggregate packet rate**: PDR_LOWER <bi-directional packet rate>
26     pps.
27   - **Aggregate bandwidth rate**: PDR_LOWER <bi-directional bandwidth
28     rate> Gbps.
29
30 NDR and PDR are measured for the following L2 frame sizes (untagged
31 Ethernet):
32
33 - IPv4 payload: 64B, IMIX_v4_1 (28x64B, 16x570B, 4x1518B), 1518B, 9000B.
34 - IPv6 payload: 78B, 1518B, 9000B.
35
36 All rates are reported from external Traffic Generator perspective.
37
38 Description of MLRsearch algorithm is provided in
39 :ref:`mlrsearch_algorithm`.
40
41 Maximum Receive Rate MRR
42 ------------------------
43
44 MRR tests measure the packet forwarding rate under the maximum
45 load offered by traffic generator over a set trial duration,
46 regardless of packet loss. Maximum load for specified Ethernet frame
47 size is set to the bi-directional link rate.
48
49 Current parameters for MRR tests:
50
51 - Ethernet frame sizes: 64B (78B for IPv6), IMIX, 1518B, 9000B; all
52   quoted sizes include frame CRC, but exclude per frame transmission
53   overhead of 20B (preamble, inter frame gap).
54
55 - Maximum load offered: 10GE and 40GE link (sub-)rates depending on NIC
56   tested, with the actual packet rate depending on frame size,
57   transmission overhead and traffic generator NIC forwarding capacity.
58
59   - For 10GE NICs the maximum packet rate load is 2* 14.88 Mpps for 64B,
60     a 10GE bi-directional link rate.
61   - For 25GE NICs the maximum packet rate load is 2* 18.75 Mpps for 64B,
62     a 25GE bi-directional link sub-rate limited by TG 25GE NIC used,
63     XXV710.
64   - For 40GE NICs the maximum packet rate load is 2* 18.75 Mpps for 64B,
65     a 40GE bi-directional link sub-rate limited by TG 40GE NIC used,
66     XL710. Packet rate for other tested frame sizes is limited by PCIe
67     Gen3 x8 bandwidth limitation of ~50Gbps.
68
69 - Trial duration: 10sec.
70
71 Similarly to NDR/PDR throughput tests, MRR test should be reporting bi-
72 directional link rate (or NIC rate, if lower) if tested VPP
73 configuration can handle the packet rate higher than bi-directional link
74 rate, e.g. large packet tests and/or multi-core tests.
75
76 MRR tests are used for continuous performance trending and for
77 comparison between releases. Daily trending job tests subset of frame
78 sizes, focusing on 64B (78B for IPv6) for all tests and IMIX for
79 selected tests (vhost, memif).
80
81 Packet Latency
82 --------------
83
84 TRex Traffic Generator (TG) is used for measuring latency of VPP DUTs.
85 Reported latency values are measured using following methodology:
86
87 - Latency tests are performed at 100% of discovered NDR and PDR rates
88   for each throughput test and packet size (except IMIX).
89 - TG sends dedicated latency streams, one per direction, each at the
90   rate of 9 kpps at the prescribed packet size; these are sent in
91   addition to the main load streams.
92 - TG reports min/avg/max latency values per stream direction, hence two
93   sets of latency values are reported per test case; future release of
94   TRex is expected to report latency percentiles.
95 - Reported latency values are aggregate across two SUTs due to three
96   node topology used for all performance tests; for per SUT latency,
97   reported value should be divided by two.
98 - 1usec is the measurement accuracy advertised by TRex TG for the setup
99   used in FD.io labs used by CSIT project.
100 - TRex setup introduces an always-on error of about 2*2usec per latency
101   flow additonal Tx/Rx interface latency induced by TRex SW writing and
102   reading packet timestamps on CPU cores without HW acceleration on NICs
103   closer to the interface line.
104
105 Multi-Core Speedup
106 ------------------
107
108 All performance tests are executed with single processor core and with
109 multiple cores scenarios.
110
111 Intel Hyper-Threading (HT)
112 ~~~~~~~~~~~~~~~~~~~~~~~~~~
113
114 Intel Xeon processors used in FD.io CSIT can operate either in HT
115 Disabled mode (single logical core per each physical core) or in HT
116 Enabled mode (two logical cores per each physical core). HT setting is
117 applied in BIOS and requires server SUT reload for it to take effect,
118 making it impractical for continuous changes of HT mode of operation.
119
120 |csit-release| performance tests are executed with server SUTs' Intel
121 XEON processors configured with Intel Hyper-Threading Disabled for all
122 Xeon Haswell testbeds (3n-hsw) and with Intel Hyper-Threading Enabled
123 for all Xeon Skylake testbeds.
124
125 More information about physical testbeds is provided in
126 :ref:`tested_physical_topologies`.
127
128 Multi-core Tests
129 ~~~~~~~~~~~~~~~~
130
131 |csit-release| multi-core tests are executed in the following VPP worker
132 thread and physical core configurations:
133
134 #. Intel Xeon Haswell testbeds (3n-hsw) with Intel HT disabled
135    (1 logical CPU core per each physical core):
136
137   #. 1t1c - 1 VPP worker thread on 1 physical core.
138   #. 2t2c - 2 VPP worker threads on 2 physical cores.
139   #. 4t4c - 4 VPP worker threads on 4 physical cores.
140
141 #. Intel Xeon Skylake testbeds (2n-skx, 3n-skx) with Intel HT enabled
142    (2 logical CPU cores per each physical core):
143
144   #. 2t1c - 2 VPP worker threads on 1 physical core.
145   #. 4t2c - 4 VPP worker threads on 2 physical cores.
146   #. 8t4c - 8 VPP worker threads on 4 physical cores.
147
148 VPP worker threads are the data plane threads running on isolated
149 logical cores. With Intel HT enabled VPP workers are placed as sibling
150 threads on each used physical core. VPP control threads (main, stats)
151 are running on a separate non-isolated core together with other Linux
152 processes.
153
154 In all CSIT tests care is taken to ensure that each VPP worker handles
155 the same amount of received packet load and does the same amount of
156 packet processing work. This is achieved by evenly distributing per
157 interface type (e.g. physical, virtual) receive queues over VPP workers
158 using default VPP round- robin mapping and by loading these queues with
159 the same amount of packet flows.
160
161 If number of VPP workers is higher than number of physical or virtual
162 interfaces, multiple receive queues are configured on each interface.
163 NIC Receive Side Scaling (RSS) for physical interfaces and multi-queue
164 for virtual interfaces are used for this purpose.
165
166 Section :ref:`throughput_speedup_multi_core` includes a set of graphs
167 illustrating packet throughout speedup when running VPP worker threads
168 on multiple cores. Note that in quite a few test cases running VPP
169 workers on 2 or 4 physical cores hits the I/O bandwidth or packets-per-
170 second limit of tested NIC.
171
172 VPP Startup Settings
173 --------------------
174
175 CSIT code manipulates a number of VPP settings in startup.conf for optimized
176 performance. List of common settings applied to all tests and test
177 dependent settings follows.
178
179 See `VPP startup.conf <https://git.fd.io/vpp/tree/src/vpp/conf/startup.conf?h=stable/1807>`_
180 for a complete set and description of listed settings.
181
182 Common Settings
183 ~~~~~~~~~~~~~~~
184
185 List of vpp startup.conf settings applied to all tests:
186
187 #. heap-size <value> - set separately for ip4, ip6, stats, main
188    depending on scale tested.
189 #. no-tx-checksum-offload - disables UDP / TCP TX checksum offload in DPDK.
190    Typically needed for use faster vector PMDs (together with
191    no-multi-seg).
192 #. socket-mem <value>,<value> - memory per numa. (Not required anymore
193    due to VPP code changes, should be removed in CSIT-18.10.)
194
195 Per Test Settings
196 ~~~~~~~~~~~~~~~~~
197
198 List of vpp startup.conf settings applied dynamically per test:
199
200 #. corelist-workers <list_of_cores> - list of logical cores to run VPP
201    worker data plane threads. Depends on HyperThreading and core per
202    test configuration.
203 #. num-rx-queues <value> - depends on a number of VPP threads and NIC
204    interfaces.
205 #. num-rx-desc/num-tx-desc - number of rx/tx descriptors for specific
206    NICs, incl. xl710, x710, xxv710.
207 #. num-mbufs <value> - increases number of buffers allocated, needed
208    only in scenarios with large number of interfaces and worker threads.
209    Value is per CPU socket. Default is 16384.
210 #. no-multi-seg - disables multi-segment buffers in DPDK, improves
211    packet throughput, but disables Jumbo MTU support. Disabled for all
212    tests apart from the ones that require Jumbo 9000B frame support.
213 #. UIO driver - depends on topology file definition.
214 #. QAT VFs - depends on NRThreads, each thread = 1QAT VFs.
215
216 KVM VMs vhost-user
217 ------------------
218
219 FD.io CSIT performance lab is testing VPP vhost with KVM VMs using
220 following environment settings:
221
222 - Tests with varying Qemu virtio queue (a.k.a. vring) sizes: [vr256]
223   default 256 descriptors, [vr1024] 1024 descriptors to optimize for
224   packet throughput.
225 - Tests with varying Linux :abbr:`CFS (Completely Fair Scheduler)`
226   settings: [cfs] default settings, [cfsrr1] CFS RoundRobin(1) policy
227   applied to all data plane threads handling test packet path including
228   all VPP worker threads and all Qemu testpmd poll-mode threads.
229 - Resulting test cases are all combinations with [vr256,vr1024] and
230   [cfs,cfsrr1] settings.
231 - Adjusted Linux kernel :abbr:`CFS (Completely Fair Scheduler)`
232   scheduler policy for data plane threads used in CSIT is documented in
233   `CSIT Performance Environment Tuning wiki <https://wiki.fd.io/view/CSIT/csit-perf-env-tuning-ubuntu1604>`_.
234 - The purpose is to verify performance impact (MRR and NDR/PDR
235   throughput) and same test measurements repeatability, by making VPP
236   and VM data plane threads less susceptible to other Linux OS system
237   tasks hijacking CPU cores running those data plane threads.
238
239 LXC/DRC Container Memif
240 -----------------------
241
242 |csit-release| includes tests taking advantage of VPP memif virtual
243 interface (shared memory interface) to interconnect VPP running in
244 Containers. VPP vswitch instance runs in bare-metal user-mode handling
245 NIC interfaces and connecting over memif (Slave side) to VPPs running in
246 :abbr:`Linux Container (LXC)` or in Docker Container (DRC) configured
247 with memif (Master side). LXCs and DRCs run in a priviliged mode with
248 VPP data plane worker threads pinned to dedicated physical CPU cores per
249 usual CSIT practice. All VPP instances run the same version of software.
250 This test topology is equivalent to existing tests with vhost-user and
251 VMs as described earlier in :ref:`tested_logical_topologies`.
252
253 In addition to above vswitch tests, a single memif interface test is
254 executed. It runs in a simple topology of two VPP container instances
255 connected over memif interface in order to verify standalone memif
256 interface performance.
257
258 More information about CSIT LXC and DRC setup and control is available
259 in :ref:`container_orchestration_in_csit`.
260
261 K8s Container Memif
262 -------------------
263
264 |csit-release| includes tests of VPP topologies running in K8s
265 orchestrated Pods/Containers and connected over memif virtual
266 interfaces. In order to provide simple topology coding flexibility and
267 extensibility container orchestration is done with `Kubernetes
268 <https://github.com/kubernetes>`_ using `Docker
269 <https://github.com/docker>`_ images for all container applications
270 including VPP. `Ligato <https://github.com/ligato>`_ is used for the
271 Pod/Container networking orchestration that is integrated with K8s,
272 including memif support.
273
274 In these tests VPP vswitch runs in a K8s Pod with Docker Container (DRC)
275 handling NIC interfaces and connecting over memif to more instances of
276 VPP running in Pods/DRCs. All DRCs run in a priviliged mode with VPP
277 data plane worker threads pinned to dedicated physical CPU cores per
278 usual CSIT practice. All VPP instances run the same version of software.
279 This test topology is equivalent to existing tests with vhost-user and
280 VMs as described earlier in :ref:`tested_physical_topologies`.
281
282 Further documentation is available in
283 :ref:`container_orchestration_in_csit`.
284
285 IPSec on Intel QAT
286 ------------------
287
288 VPP IPSec performance tests are using DPDK cryptodev device driver in
289 combination with HW cryptodev devices - Intel QAT 8950 50G - present in
290 LF FD.io physical testbeds. DPDK cryptodev can be used for all IPSec
291 data plane functions supported by VPP.
292
293 Currently |csit-release| implements following IPSec test cases:
294
295 - AES-GCM, CBC-SHA1 ciphers, in combination with IPv4 routed-forwarding
296   with Intel xl710 NIC.
297 - CBC-SHA1 ciphers, in combination with LISP-GPE overlay tunneling for
298   IPv4-over-IPv4 with Intel xl710 NIC.
299
300 TRex Traffic Generator
301 ----------------------
302
303 Usage
304 ~~~~~
305
306 `TRex traffic generator <https://wiki.fd.io/view/TRex>`_ is used for all
307 CSIT performance tests. TRex stateless mode is used to measure NDR and
308 PDR throughputs using binary search (NDR and PDR discovery tests) and
309 for quick checks of DUT performance against the reference NDRs (NDR
310 check tests) for specific configuration.
311
312 TRex is installed and run on the TG compute node. The typical procedure
313 is:
314
315 - If the TRex is not already installed on TG, it is installed in the
316   suite setup phase - see `TRex intallation`_.
317 - TRex configuration is set in its configuration file
318   ::
319
320   /etc/trex_cfg.yaml
321
322 - TRex is started in the background mode
323   ::
324
325   $ sh -c 'cd <t-rex-install-dir>/scripts/ && sudo nohup ./t-rex-64 -i -c 7 --iom 0 > /tmp/trex.log 2>&1 &' > /dev/null
326
327 - There are traffic streams dynamically prepared for each test, based on traffic
328   profiles. The traffic is sent and the statistics obtained using
329   :command:`trex_stl_lib.api.STLClient`.
330
331 Measuring Packet Loss
332 ~~~~~~~~~~~~~~~~~~~~~
333
334 Following sequence is followed to measure packet loss:
335
336 - Create an instance of STLClient.
337 - Connect to the client.
338 - Add all streams.
339 - Clear statistics.
340 - Send the traffic for defined time.
341 - Get the statistics.
342
343 If there is a warm-up phase required, the traffic is sent also before
344 test and the statistics are ignored.
345
346 Measuring Latency
347 ~~~~~~~~~~~~~~~~~
348
349 If measurement of latency is requested, two more packet streams are
350 created (one for each direction) with TRex flow_stats parameter set to
351 STLFlowLatencyStats. In that case, returned statistics will also include
352 min/avg/max latency values.
353
354 HTTP/TCP with WRK tool
355 ----------------------
356
357 `WRK HTTP benchmarking tool <https://github.com/wg/wrk>`_ is used for
358 experimental TCP/IP and HTTP tests of VPP TCP/IP stack and built-in
359 static HTTP server. WRK has been chosen as it is capable of generating
360 significant TCP/IP and HTTP loads by scaling number of threads across
361 multi-core processors.
362
363 This in turn enables quite high scale benchmarking of the main TCP/IP
364 and HTTP service including HTTP TCP/IP Connections-Per-Second (CPS),
365 HTTP Requests-Per-Second and HTTP Bandwidth Throughput.
366
367 The initial tests are designed as follows:
368
369 - HTTP and TCP/IP Connections-Per-Second (CPS)
370
371   - WRK configured to use 8 threads across 8 cores, 1 thread per core.
372   - Maximum of 50 concurrent connections across all WRK threads.
373   - Timeout for server responses set to 5 seconds.
374   - Test duration is 30 seconds.
375   - Expected HTTP test sequence:
376
377     - Single HTTP GET Request sent per open connection.
378     - Connection close after valid HTTP reply.
379     - Resulting flow sequence - 8 packets: >Syn, <Syn-Ack, >Ack, >Req,
380       <Rep, >Fin, <Fin, >Ack.
381
382 - HTTP Requests-Per-Second
383
384   - WRK configured to use 8 threads across 8 cores, 1 thread per core.
385   - Maximum of 50 concurrent connections across all WRK threads.
386   - Timeout for server responses set to 5 seconds.
387   - Test duration is 30 seconds.
388   - Expected HTTP test sequence:
389
390     - Multiple HTTP GET Requests sent in sequence per open connection.
391     - Connection close after set test duration time.
392     - Resulting flow sequence: >Syn, <Syn-Ack, >Ack, >Req[1], <Rep[1],
393       .., >Req[n], <Rep[n], >Fin, <Fin, >Ack.