Configuring HugePage
This chapter describes how to configure HugePage for each operating system.
Linux
This section describes how to configure HugePage in Linux. Root permission is required.
Linux supports Transparent Huge Pages (THP), a capability to automatically increase the memory size according to the memory usage patterns in the OS.
THP allows not only shared memory but also process memory to run as HugePage, and this may affect the system performance. Therefore, it is recommended to disable the THP capability by setting the relevant kernel parameter to 'never'.
Enabling HugePage
The following describes how to enable HugePage.
Check the size of HugePage supported in the current OS.
Check the user group ID that runs Tibero.
Apply the groups and number that will allocate HugePage in "/etc/sysctl.conf"
vm.nr_hugepages
Number of HugePages.
Size of TOTAL_SHM_SIZE / HugePage.
vm.hugetlb_shm_group
Group ID that will allocate HugePage.
User group ID that runs Tibero.
The following is an example of applying the kernel parameter when TOTAL_SHM_SIZE is set to 1024 MB and the size of HugePage supported by the current OS is 2 MB (2048 KB).
Apply the maximum locked memory value in "/etc/security/limits.conf".
memlock
HugePage size * number of HugePages
The following is an example of configuring the memlock value.
Restart the operating system.
The modified HugePage value has been applied.
Configure the Tibero initialization parameters in the configuration file (.tip).
TOTAL_SHM_SIZE
HugePage size * HugePage count
USE_HUGE_PAGE
Y
The following is an example of configuring the initialization parameters.
Restart the Tibero server.
Disabling HugePage
To disable HugePage, restore the values that were modified to enable HugePage to their original values. The modified values can be restored by the same process and order used to enable HugePage.
AIX
AIX uses Large Page instead of HugePage. The benefits of using Large Page are similar to those of HugePage.
Enabling HugePage
The following describes how to enable HugePage.
1. Change the Large Page configuration value of the OS.
AIX internally maintains physical memory pool sizes of 4 KB and 16 MB. The size of this pool can be changed to 16 MB by using the vmo command. The remaining space is automatically allocated to the 4 KB pool. From AIX 5.3 on, Large Page pools are dynamically maintained, so the system does not need to be restarted after changing the size.
First, v_pinshm must be separately configured so that the space in which the shared memory is allocated is not swapped to disk. percent_of_real_memory is the amount of memory that TSM possesses as a percentage of the total memory.
Configure the Large Page pool size. num_of_lage_pages is an integer and is equal to TSM / 16 MB.
2. Configure user permissions.
According to the security policy, all users (except the root user) must have the CAP_BYPASS_RAC_VMM permission to use Large Page. The permission can be configured by using the chuser command.
3. Configure the following Tibero initialization parameters in the environment configuration file (.tip).
TOTAL_SHM_SIZE
1 GB (Default value)
USE_HUGE_PAGE
Y
The following example configures the initialization parameters.
4. Restart the Tibero server.
Disabling HugePage
To disable Large Page, restore the values that were modified to enable Large Page to their original values.
Solaris
The functionality of HugePage can be applied by using the ISM (Intimate Shared Memory) function through Large Page.
The advantages of using ISM are as follows:
ISM shared memory is automatically locked by the OS when it is created. This ensures that the memory segment is not swapped to disk. It also allows the kernel to use a fast locking mechanism for I/O of the shared memory segment.
The memory structure used to convert the kernel's virtual memory address into a physical memory address is shared between multiple processes. This sharing reduces CPU consumption and conserves kernel memory space.
Large Page supported in the system's MMU (Memory Management Unit) is automatically allocated in the ISM memory segment. This allocation improves system performance by conserving memory space for managing pages and by simplifying virtual memory address conversion.
Enabling HugePage
To enable HugePage, configure the server initialization parameter as follows.
The parameter is only valid in Solaris and the default value is Y.
If this function is turned on, shmget is used to create shared memory and the SHM_SHARED_MMU option is added when attaching with shmat. This function is only applied in the server process and the listener process. The client module that attaches the server's TSM does not use this option. However, if the parameter is not set to Y, change the value to Y and restart the Tibero server.
Disabling HugePage
Set the server initialization parameter _USE_ISM to N and then restart the Tibero server.
Recommended Settings
Tibero does not restrict the size of HugePage, which can be set within the range allowed by different operating systems.
The recommended settings are as follows:
For small memory (less than 64GB): 4MB
For large memory (more than 64GB): 16MB
Last updated