rls1807 report: moved and renamed s/mdr_search/mlr_search/.
[csit.git] / docs / report / vpp_performance_tests / methodology.rst
1 Test Methodology
2 ================
3
4 Multi-Core and Multi-Threading
5 ------------------------------
6
7 **Intel Hyper-Threading** - CSIT |release| performance tests are executed with
8 SUT servers' Intel XEON processors configured in Intel Hyper-Threading Disabled
9 mode (BIOS setting). This is the simplest configuration used to establish
10 baseline single-thread single-core application packet processing and forwarding
11 performance. Subsequent releases of CSIT will add performance tests with Intel
12 Hyper-Threading Enabled (requires BIOS settings change and hard reboot of
13 server).
14
15 **Multi-core Tests** - CSIT |release| multi-core tests are executed in the
16 following VPP thread and core configurations:
17
18 #. 1t1c - 1 VPP worker thread on 1 CPU physical core.
19 #. 2t2c - 2 VPP worker threads on 2 CPU physical cores.
20 #. 4t4c - 4 VPP worker threads on 4 CPU physical cores.
21
22 VPP worker threads are the data plane threads. VPP control thread is
23 running on a separate non-isolated core together with other Linux
24 processes. Note that in quite a few test cases running VPP workers on 2
25 or 4 physical cores hits the I/O bandwidth or packets-per-second limit
26 of tested NIC.
27
28 Section :ref:`throughput_speedup_multi_core` includes a set of graphs
29 illustrating packet throughout speedup when running VPP on multiple
30 cores.
31
32 Packet Throughput
33 -----------------
34
35 Following values are measured and reported for packet throughput tests:
36
37 - NDR binary search per :rfc:`2544`:
38
39   - Packet rate: "RATE: <aggregate packet rate in packets-per-second> pps
40     (2x <per direction packets-per-second>)";
41   - Aggregate bandwidth: "BANDWIDTH: <aggregate bandwidth in Gigabits per
42     second> Gbps (untagged)";
43
44 - PDR binary search per :rfc:`2544`:
45
46   - Packet rate: "RATE: <aggregate packet rate in packets-per-second> pps (2x
47     <per direction packets-per-second>)";
48   - Aggregate bandwidth: "BANDWIDTH: <aggregate bandwidth in Gigabits per
49     second> Gbps (untagged)";
50   - Packet loss tolerance: "LOSS_ACCEPTANCE <accepted percentage of packets
51     lost at PDR rate>";
52
53 - NDR and PDR are measured for the following L2 frame sizes (untagged
54   Ethernet):
55
56   - IPv4 payload: 64B, IMIX_v4_1 (28x64B,16x570B,4x1518B), 1518B, 9000B;
57   - IPv6 payload: 78B, 1518B, 9000B;
58
59 - NDR and PDR binary search resolution is determined by the final value of the
60   rate change, referred to as the final step:
61
62   - The final step is set to 50kpps for all NIC to NIC tests and all L2
63     frame sizes except 9000B (changed from 100kpps used in previous
64     releases).
65
66   - The final step is set to 10kpps for all remaining tests, including 9000B
67     and all vhost VM and memif Container tests.
68
69 All rates are reported from external Traffic Generator perspective.
70
71 Maximum Receive Rate (MRR)
72 --------------------------
73
74 MRR tests measure the packet forwarding rate under the maximum
75 load offered by traffic generator over a set trial duration,
76 regardless of packet loss. Maximum load for specified Ethernet frame
77 size is set to the bi-directional link rate.
78
79 Current parameters for MRR tests:
80
81 - Ethernet frame sizes: 64B (78B for IPv6 tests) for all tests, IMIX for
82   selected tests (vhost, memif); all quoted sizes include frame CRC, but
83   exclude per frame transmission overhead of 20B (preamble, inter frame
84   gap).
85
86 - Maximum load offered: 10GE and 40GE link (sub-)rates depending on NIC
87   tested, with the actual packet rate depending on frame size,
88   transmission overhead and traffic generator NIC forwarding capacity.
89
90   - For 10GE NICs the maximum packet rate load is 2* 14.88 Mpps for 64B,
91     a 10GE bi-directional link rate.
92   - For 40GE NICs the maximum packet rate load is 2* 18.75 Mpps for 64B,
93     a 40GE bi-directional link sub-rate limited by TG 40GE NIC used,
94     XL710.
95
96 - Trial duration: 10sec.
97
98 Similarly to NDR/PDR throughput tests, MRR test should be reporting bi-
99 directional link rate (or NIC rate, if lower) if tested VPP
100 configuration can handle the packet rate higher than bi-directional link
101 rate, e.g. large packet tests and/or multi-core tests.
102
103 MRR tests are used for continuous performance trending and for
104 comparison between releases.
105
106 Packet Latency
107 --------------
108
109 TRex Traffic Generator (TG) is used for measuring latency of VPP DUTs. Reported
110 latency values are measured using following methodology:
111
112 - Latency tests are performed at 10%, 50% of discovered NDR rate (non drop rate)
113   for each NDR throughput test and packet size (except IMIX).
114 - TG sends dedicated latency streams, one per direction, each at the rate of
115   10kpps at the prescribed packet size; these are sent in addition to the main
116   load streams.
117 - TG reports min/avg/max latency values per stream direction, hence two sets
118   of latency values are reported per test case; future release of TRex is
119   expected to report latency percentiles.
120 - Reported latency values are aggregate across two SUTs due to three node
121   topology used for all performance tests; for per SUT latency, reported value
122   should be divided by two.
123 - 1usec is the measurement accuracy advertised by TRex TG for the setup used in
124   FD.io labs used by CSIT project.
125 - TRex setup introduces an always-on error of about 2*2usec per latency flow -
126   additonal Tx/Rx interface latency induced by TRex SW writing and reading
127   packet timestamps on CPU cores without HW acceleration on NICs closer to the
128   interface line.
129
130 vhostuser with KVM VMs
131 ----------------------
132
133 FD.io CSIT performance lab is testing VPP vhost with KVM VMs using following
134 environment settings:
135
136 - Tests with varying Qemu virtio queue (a.k.a. vring) sizes: [vr256] default 256
137   descriptors, [vr1024] 1024 descriptors to optimize for packet throughput.
138
139 - Tests with varying Linux :abbr:`CFS (Completely Fair Scheduler)` settings:
140   [cfs] default settings, [cfsrr1] CFS RoundRobin(1) policy applied to all data
141   plane threads handling test packet path including all VPP worker threads and
142   all Qemu testpmd poll-mode threads.
143
144 - Resulting test cases are all combinations with [vr256,vr1024] and
145   [cfs,cfsrr1] settings.
146
147 - Adjusted Linux kernel :abbr:`CFS (Completely Fair Scheduler)` scheduler policy
148   for data plane threads used in CSIT is documented in
149   `CSIT Performance Environment Tuning wiki <https://wiki.fd.io/view/CSIT/csit-perf-env-tuning-ubuntu1604>`_.
150   The purpose is to verify performance impact (MRR and NDR/PDR
151   throughput) and same test measurements repeatability, by making VPP
152   and VM data plane threads less susceptible to other Linux OS system
153   tasks hijacking CPU cores running those data plane threads.
154
155 Memif with LXC and Docker Containers
156 ------------------------------------
157
158 CSIT |release| includes tests taking advantage of VPP memif virtual
159 interface (shared memory interface) to interconnect VPP running in
160 Containers. VPP vswitch instance runs in bare-metal user-mode handling
161 NIC interfaces and connecting over memif (Slave side) to VPPs running in
162 :abbr:`Linux Container (LXC)` or in Docker Container (DRC) configured
163 with memif (Master side). LXCs and DRCs run in a priviliged mode with
164 VPP data plane worker threads pinned to dedicated physical CPU cores per
165 usual CSIT practice. All VPP instances run the same version of software.
166 This test topology is equivalent to existing tests with vhost-user and
167 VMs as described earlier in :ref:`tested_physical_topologies`.
168
169 More information about CSIT LXC and DRC setup and control is available
170 in :ref:`container_orchestration_in_csit`.
171
172 Memif with K8s Pods/Containers
173 ------------------------------
174
175 CSIT |release| includes tests of VPP topologies running in K8s
176 orchestrated Pods/Containers and connected over memif virtual
177 interfaces. In order to provide simple topology coding flexibility and
178 extensibility container orchestration is done with `Kubernetes
179 <https://github.com/kubernetes>`_ using `Docker
180 <https://github.com/docker>`_ images for all container applications
181 including VPP. `Ligato <https://github.com/ligato>`_ is used for the
182 Pod/Container networking orchestration that is integrated with K8s,
183 including memif support.
184
185 In these tests VPP vswitch runs in a K8s Pod with Docker Container (DRC)
186 handling NIC interfaces and connecting over memif to more instances of
187 VPP running in Pods/DRCs. All DRCs run in a priviliged mode with VPP
188 data plane worker threads pinned to dedicated physical CPU cores per
189 usual CSIT practice. All VPP instances run the same version of software.
190 This test topology is equivalent to existing tests with vhost-user and
191 VMs as described earlier in :ref:`tested_physical_topologies`.
192
193 Further documentation is available in
194 :ref:`container_orchestration_in_csit`.
195
196 IPSec with Intel QAT HW cards
197 -----------------------------
198
199 VPP IPSec performance tests are using DPDK cryptodev device driver in
200 combination with HW cryptodev devices - Intel QAT 8950 50G - present in
201 LF FD.io physical testbeds. DPDK cryptodev can be used for all IPSec
202 data plane functions supported by VPP.
203
204 Currently CSIT |release| implements following IPSec test cases:
205
206 - AES-GCM, CBC-SHA1 ciphers, in combination with IPv4 routed-forwarding
207   with Intel xl710 NIC.
208 - CBC-SHA1 ciphers, in combination with LISP-GPE overlay tunneling for
209   IPv4-over-IPv4 with Intel xl710 NIC.
210
211 TRex Traffic Generator Usage
212 ----------------------------
213
214 `TRex traffic generator <https://wiki.fd.io/view/TRex>`_ is used for all
215 CSIT performance tests. TRex stateless mode is used to measure NDR and PDR
216 throughputs using binary search (NDR and PDR discovery tests) and for quick
217 checks of DUT performance against the reference NDRs (NDR check tests) for
218 specific configuration.
219
220 TRex is installed and run on the TG compute node. The typical procedure is:
221
222 - If the TRex is not already installed on TG, it is installed in the
223   suite setup phase - see `TRex intallation`_.
224 - TRex configuration is set in its configuration file
225   ::
226
227   /etc/trex_cfg.yaml
228
229 - TRex is started in the background mode
230   ::
231
232   $ 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
233
234 - There are traffic streams dynamically prepared for each test, based on traffic
235   profiles. The traffic is sent and the statistics obtained using
236   :command:`trex_stl_lib.api.STLClient`.
237
238 **Measuring packet loss**
239
240 - Create an instance of STLClient
241 - Connect to the client
242 - Add all streams
243 - Clear statistics
244 - Send the traffic for defined time
245 - Get the statistics
246
247 If there is a warm-up phase required, the traffic is sent also before test and
248 the statistics are ignored.
249
250 **Measuring latency**
251
252 If measurement of latency is requested, two more packet streams are created (one
253 for each direction) with TRex flow_stats parameter set to STLFlowLatencyStats. In
254 that case, returned statistics will also include min/avg/max latency values.
255
256 TCP/IP tests with WRK tool
257 --------------------------
258
259 `WRK HTTP benchmarking tool <https://github.com/wg/wrk>`_ is used for
260 experimental TCP/IP and HTTP tests of VPP TCP/IP stack and built-in
261 static HTTP server. WRK has been chosen as it is capable of generating
262 significant TCP/IP and HTTP loads by scaling number of threads across
263 multi-core processors.
264
265 This in turn enables quite high scale benchmarking of the main TCP/IP
266 and HTTP service including HTTP TCP/IP Connections-Per-Second (CPS),
267 HTTP Requests-Per-Second and HTTP Bandwidth Throughput.
268
269 The initial tests are designed as follows:
270
271 - HTTP and TCP/IP Connections-Per-Second (CPS)
272
273   - WRK configured to use 8 threads across 8 cores, 1 thread per core.
274   - Maximum of 50 concurrent connections across all WRK threads.
275   - Timeout for server responses set to 5 seconds.
276   - Test duration is 30 seconds.
277   - Expected HTTP test sequence:
278
279     - Single HTTP GET Request sent per open connection.
280     - Connection close after valid HTTP reply.
281     - Resulting flow sequence - 8 packets: >S,<S-A,>A,>Req,<Rep,>F,<F,> A.
282
283 - HTTP Requests-Per-Second
284
285   - WRK configured to use 8 threads across 8 cores, 1 thread per core.
286   - Maximum of 50 concurrent connections across all WRK threads.
287   - Timeout for server responses set to 5 seconds.
288   - Test duration is 30 seconds.
289   - Expected HTTP test sequence:
290
291     - Multiple HTTP GET Requests sent in sequence per open connection.
292     - Connection close after set test duration time.
293     - Resulting flow sequence: >S,<S-A,>A,>Req[1],<Rep[1],..,>Req[n],<Rep[n],>F,<F,>A.