blob: 42f6aa30282f3e7a3bf4f9864e15d92ff41789ae [file] [log] [blame]
John DeNisco06dcd452018-07-26 12:45:10 -04001.. _hugepages:
2
3Huge Pages
4----------
5
6VPP requires *'hugepages'* to run. VPP will overwrite existing hugepage
7settings when VPP is installed. By default, VPP sets the number of hugepages on
8a system to 1024 2M hugepages (1G hugepages are no longer supported). This is
9the number of hugepages on the system, not just used by VPP. When VPP is
10installed, the following file is copied to the system and used to apply the
11hugepage settings on VPP installation and system reboot:
12
13.. code-block:: console
14
15 $ cat /etc/sysctl.d/80-vpp.conf
16 # Number of 2MB hugepages desired
17 vm.nr_hugepages=1024
18
19 # Must be greater than or equal to (2 * vm.nr_hugepages).
20 vm.max_map_count=3096
21
22 # All groups allowed to access hugepages
23 vm.hugetlb_shm_group=0
24
25 # Shared Memory Max must be greator or equal to the total size of hugepages.
26 # For 2MB pages, TotalHugepageSize = vm.nr_hugepages * 2 * 1024 * 1024
27 # If the existing kernel.shmmax setting (cat /sys/proc/kernel/shmmax)
28 # is greater than the calculated TotalHugepageSize then set this parameter
29 # to current shmmax value.
30 kernel.shmmax=2147483648
31
32Depending on how the system is being used, this file can be updated to adjust
33the number of hugepages reserved on a system. Below are some examples of
34possible values.
35
36For a small VM with minimal workload:
37
38.. code-block:: console
39
40 vm.nr_hugepages=512
41 vm.max_map_count=2048
42 kernel.shmmax=1073741824
43
44For a large system running multiple VMs, each needing its own set of hugepages:
45
46.. code-block:: console
47
48 vm.nr_hugepages=32768
49 vm.max_map_count=66560
50 kernel.shmmax=68719476736
51
52
53.. note::
54
55 If VPP is being run in a Virtual Machine (VM), the VM must have hugepage
56 backing. When VPP is installed, it will attempt to overwrite existing
57 hugepage setting. If the VM does not have hugepage backing, this will fail,
58 but this may go unnoticed. When the VM is rebooted, on system startup,
59 *'vm.nr_hugepages'* will be reapplied, will fail, and the VM will abort kernel
60 boot, locking up the VM. To avoid this scenario, ensure the VM has enough
61 hugepage backing.