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.

Enabling HugePage

The following describes how to enable HugePage.

  1. Check the size of HugePage supported in the current OS.

$ grep Hugepagesize /proc/meminfo 
Hugepagesize:	2048 KB

  1. Check the user group ID that runs Tibero.

$ id -a
uid=579(tibero) gid=579(tibero) groups=579(tibero)

  1. Apply the groups and number that will allocate HugePage in "/etc/sysctl.conf"

Kernel Parameter
Description
Expression

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).

$ cat /etc/sysctl.conf
......Omitted......
vm.nr_hugepages=512 
vm.hugetlb_shm_group=579

  1. Apply the maximum locked memory value in "/etc/security/limits.conf".

Value
Expression

memlock

HugePage size * number of HugePages

The following is an example of configuring the memlock value.

$ cat /etc/security/limits.conf
......Omitted......
tibero	soft	memlock    1048576
tibero	hard	memlock    1048576

  1. Restart the operating system.

The modified HugePage value has been applied.

$ egrep -e HugePages_Total /proc/meminfo 
HugePages_Total: 512 KB

  1. Configure the Tibero initialization parameters in the configuration file (.tip).

Initialization Parameter
Value

TOTAL_SHM_SIZE

HugePage size * HugePage count

USE_HUGE_PAGE

Y

The following is an example of configuring the initialization parameters.

$ cat tibero.tip
......Omitted......
TOTAL_SHM_SIZE=1G 
USE_HUGE_PAGE=Y

  1. Restart the Tibero server.

$ tbdown

Tibero instance terminated (NORMAL mode).

$ tbboot
Listener port = 8629
Change core dump dir to /home/tibero/tibero7/instance/tibero.

Tibero 7

TmaxData Corporation Copyright (c) 2008-. All rights reserved. 
Tibero instance started up (NORMAL mode).

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.

$ vmo r o v_pinshm=1
$ vmo r o maxpin%=percent_of_real_memory

Configure the Large Page pool size. num_of_lage_pages is an integer and is equal to TSM / 16 MB.

$ vmo p o lgpg_regions=num_of_lage_pages o lgpg_size=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.

$ chuser capabilities=CAP_NUMA_ATTACH,CAP_BYPASS_RAC_VMM,CAP_PROPAGATE <user id>

3. Configure the following Tibero initialization parameters in the environment configuration file (.tip).

Initialization Parameter
Value

TOTAL_SHM_SIZE

1 GB (Default value)

USE_HUGE_PAGE

Y

The following example configures the initialization parameters.

$ cat tibero.tip
......Omitted......
TOTAL_SHM_SIZE=1G 
USE_HUGE_PAGE=Y

4. Restart the Tibero server.

$ tbdown

Tibero instance terminated (NORMAL mode).

$ tbboot
Listener port = 8629
Change core dump dir to /home/tibero/tibero7/instance/tibero. 

Tibero 7
TmaxData Corporation Copyright (c) 2008-. All rights reserved. 
Tibero instance started up (NORMAL mode).

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.

USE_ISM=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.

_USE_ISM=N


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