John DeNisco | 06dcd45 | 2018-07-26 12:45:10 -0400 | [diff] [blame^] | 1 | .. _hugepages: |
| 2 | |
| 3 | Huge Pages |
| 4 | ---------- |
| 5 | |
| 6 | VPP requires *'hugepages'* to run. VPP will overwrite existing hugepage |
| 7 | settings when VPP is installed. By default, VPP sets the number of hugepages on |
| 8 | a system to 1024 2M hugepages (1G hugepages are no longer supported). This is |
| 9 | the number of hugepages on the system, not just used by VPP. When VPP is |
| 10 | installed, the following file is copied to the system and used to apply the |
| 11 | hugepage 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 | |
| 32 | Depending on how the system is being used, this file can be updated to adjust |
| 33 | the number of hugepages reserved on a system. Below are some examples of |
| 34 | possible values. |
| 35 | |
| 36 | For 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 | |
| 44 | For 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. |