Using Large Pages
Note: This feature requires a good understanding of memory management.
To reduce TLB (translation lookaside buffer) misses, modern CPUs offer a feature called "large pages" ("huge pages" on Linux). Large pages allow a page size of 2 MB (on some CPUs even 1 GB) instead of 4 KB. Using a larger page size is especially beneficial when accessing large amounts of memory with a random pattern. X100 supports the use of large pages for certain data structures that would benefit the most.
Note: Consult the documentation for your operating system for details on how to enable large page support.
Linux: Some modern Linux systems (such as RHEL 6) have transparent huge pages functionality. Huge pages are used automatically and do not have to be configured manually. In such cases, do not use the X100 options for huge pages. Consult the documentation for your operating system to see if the operating system supports transparent huge pages and if it needs to be enabled.
Configuration
You must designate an amount of memory for large pages before starting Actian X. This memory is used for large page allocations only, not for normal allocations. Because this division of memory is static, you should wisely choose the amount of memory available in large pages.
Note: The large pages feature applies to query memory only, not to buffer memory. Do not assign a significantly higher amount of memory to large pages than the X100 [memory] max_memory_size parameter. Doing so may not leave enough "normal" memory for the buffer pool and other processes in the system.
If you encounter problems with large pages, you can switch it off in the vectorwise.conf file by setting [memory]
use_huge_tlb (see
use_huge_tlb) to FALSE.
Requirements for Huge Pages on Linux
To enable the use of huge pages in Actian X the following is needed:
• Kernel support. (Most distributions enable this in the standard kernel.)
• libhugetlbfs library must be installed.
For easier administration of this feature, extra tools are recommended, often found in a package called libhugetlbfs-utils or similar.
Designate Memory for Huge Pages on Linux
The commands and amounts provided here is an example of designating memory for huge pages on Linux. Before issuing these commands, understand what they do, and adapt the examples, as needed. Reserving pages for use in huge page allocations is system wide, so make sure you are not interfering with other users.
To make 2 GB available for 2 MB huge pages, issue the following commands as root on the command line before starting Actian X:
hugeadm --create-global-mounts
hugeadm --pool-pages-min 2M:1024
To switch off, enter the following command as root on the command line:
hugeadm --pool-pages-min 2M:0
To check if memory is allocated for huge pages and how much of it is in use, type at the command line:
cat /proc/meminfo
The information about huge pages is shown in the following example lines:
HugePages_Total: 1024
HugePages_Free: 1024
HugePages_Rsvd: 0
HugePages_Surp: 0
Making memory available for huge pages requires defragmenting the specified amount of memory, so it can take a while. Typically, it is fastest to do this immediately after system startup, when memory is not as fragmented.
For more in-depth information, see the man page of hugeadm (
https://linux.die.net/man/8/hugeadm) and vm/hugetlbpage.txt (
https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt) in the Linux kernel documentation.
Last modified date: 11/09/2022