Update documentation structure.
[kvmfornfv.git] / docs / release / configurationguide / low-latency.feature.configuration.description.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3
4 =============================================
5 Low Latency Feature Configuration Description
6 =============================================
7
8 Introduction
9 ------------
10 In KVM4NFV project, we focus on the KVM hypervisor to enhance it for NFV, by
11 looking at the following areas initially
12
13 * Minimal Interrupt latency variation for data plane VNFs:
14    * Minimal Timing Variation for Timing correctness of real-time VNFs
15    * Minimal packet latency variation for data-plane VNFs
16 * Inter-VM communication,
17 * Fast live migration
18
19 Configuration of Cyclictest
20 ---------------------------
21
22 Cyclictest measures Latency of response to a stimulus. Achieving low latency
23 with the KVM4NFV project requires setting up a special test environment.
24 This environment includes the BIOS settings, kernel configuration, kernel
25 parameters and the run-time environment.
26
27 * For more information regarding the test environment, please visit
28   https://wiki.opnfv.org/display/kvm/KVM4NFV+Test++Environment
29   https://wiki.opnfv.org/display/kvm/Nfv-kvm-tuning
30
31 Pre-configuration activities
32 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33
34 Intel POD10 is currently used as OPNFV-KVM4NFV test environment. The rpm
35 packages from the latest build are downloaded onto Intel-Pod10 jump server
36 from artifact repository. Yardstick running in a ubuntu docker container
37 on Intel Pod10-jump server will configure the host(intel pod10 node1/node2
38 based on job type), the guest and triggers the cyclictest on the guest using
39 below sample yaml file.
40
41
42 .. code:: bash
43
44     For IDLE-IDLE test,
45
46     host_setup_seqs:
47     - "host-setup0.sh"
48     - "reboot"
49     - "host-setup1.sh"
50     - "host-run-qemu.sh"
51
52     guest_setup_seqs:
53     - "guest-setup0.sh"
54     - "reboot"
55     - "guest-setup1.sh"
56
57 .. figure:: images/idle-idle-test.png
58    :name: idle-idle-test
59    :width: 100%
60    :align: center
61
62 .. code:: bash
63
64     For [CPU/Memory/IO]Stress-IDLE tests,
65
66     host_setup_seqs:
67     - "host-setup0.sh"
68     - "reboot"
69     - "host-setup1.sh"
70     - "stress_daily.sh" [cpustress/memory/io]
71     - "host-run-qemu.sh"
72
73     guest_setup_seqs:
74     - "guest-setup0.sh"
75     - "reboot"
76     - "guest-setup1.sh"
77
78 .. figure:: images/stress-idle-test.png
79    :name: stress-idle-test
80    :width: 100%
81    :align: center
82
83 The following scripts are used for configuring host and guest to create a
84 special test environment and achieve low latency.
85
86 Note: host-setup0.sh, host-setup1.sh and host-run-qemu.sh are run on the host,
87 followed by guest-setup0.sh and guest-setup1.sh scripts on the guest VM.
88
89 **host-setup0.sh**: Running this script will install the latest kernel rpm
90 on host and will make necessary changes as following to create special test
91 environment.
92
93    * Isolates CPUs from the general scheduler
94    * Stops timer ticks on isolated CPUs whenever possible
95    * Stops RCU callbacks on isolated CPUs
96    * Enables intel iommu driver and disables DMA translation for devices
97    * Sets HugeTLB pages to 1GB
98    * Disables machine check
99    * Disables clocksource verification at runtime
100
101 **host-setup1.sh**: Running this script will make the following test
102 environment changes.
103
104    * Disabling watchdogs to reduce overhead
105    * Disabling RT throttling
106    * Reroute interrupts bound to isolated CPUs to CPU 0
107    * Change the iptable so that we can ssh to the guest remotely
108
109 **stress_daily.sh**: Scripts gets triggered only for stress-idle tests. Running this script
110 make the following environment changes.
111
112    * Triggers stress_script.sh, which runs the stress command with necessary options
113    * CPU,Memory or IO stress can be applied based on the test type
114    * Applying stress only on the Host is handled in D-Release
115    * For Idle-Idle test the stress script is not triggered
116    * Stress is applied only on the free cores to prevent load on qemu process
117
118    **Note:**
119     - On Numa Node 1: 22,23 cores are allocated for QEMU process
120     - 24-43 are used for applying stress
121
122 **host-run-qemu.sh**: Running this script will launch a guest vm on the host.
123      Note: download guest disk image from artifactory.
124
125 **guest-setup0.sh**: Running this scrcipt on the guest vm will install the
126 latest build kernel rpm, cyclictest and make the following configuration on
127 guest vm.
128
129    * Isolates CPUs from the general scheduler
130    * Stops timer ticks on isolated CPUs whenever possible
131    * Uses polling idle loop to improve performance
132    * Disables clocksource verification at runtime
133
134 **guest-setup1.sh**: Running this script on guest vm will do the following
135 configurations.
136
137    * Disable watchdogs to reduce overhead
138    * Routes device interrupts to non-RT CPU
139    * Disables RT throttling
140
141 Hardware configuration
142 ~~~~~~~~~~~~~~~~~~~~~~
143
144 Currently Intel POD10 is used as test environment for kvm4nfv to execute
145 cyclictest. As part of this test environment Intel pod10-jump is configured as
146 jenkins slave and all the latest build artifacts are downloaded on to it.
147
148 * For more information regarding hardware configuration, please visit
149   https://wiki.opnfv.org/display/pharos/Intel+Pod10
150   https://build.opnfv.org/ci/computer/intel-pod10/
151   http://artifacts.opnfv.org/octopus/brahmaputra/docs/octopus_docs/opnfv-jenkins-slave-connection.html