This document provides a guide for setting kernel parameters and OS user configuration for the stable operation of the Altibase server on the Linux system.
This document is based on the version below:
Altibase 5.5.1 or later
Red Hat Enterprise Linux 6 or later
Linux has many distribution types, but the Altibase compatibility check is based on glib version regardless of the distribution type and kernel version.
Starting from Altibase 5.5.1, the compatibility is checked based on the glibc version. The glibc versions with guaranteed compatibility for each Altibase server version are as follows.
Altibase Server Version | glibc Version |
---|---|
Altibase 7.1.0 | 2.12~2.20 |
Altibase 6.5.1 | 2.12~2.20 |
Altibase 6.3.1 | 2.3.4~2.20 |
Altibase 6.1.1 | 2.3.4~2.20 |
Altibase 5.5.1 | 2.3.4~2.20 |
glibc-2.12-1.166.el6_7.1 or later is recommended.
In the previous version of glibc, there was a bug in which a system call (malloc/free) function could cause deadlock due to a race condition.
How to Check the glibc Version
How to check the glibc version is as follows.
This section describes the types of kernel parameters, recommended values, and recommended reasons for configuring Altibase in Linux to operate stably.
CPU frequency Governor
RemoveIPC
swappiness
THP
max_map_count
Shared memory
Semaphore
CPU Frequency Governor
Altibase server is a system that absolutely requires maximum processing performance and shortest response time, so CPU clock speed should always be kept at the highest level.
Linux keeps pace with green IT (environmentally friendly computing) and efficiently minimizes power consumption of the system as the core of power management and provides CPUfreq Governor for this.
The default setting of OnDemand Governor in RHEL 6 has a case where the Altibase server performance cannot guarantee consistency due to the delay due to frequency change. Therefore, it is recommended to set it to 'performance' or disable this function itself.
Description | Recommended Value | |
---|---|---|
CPU frequency Governor (CPUfreq Governor) | This is a performance adjuster that adjusts CPU frequency change rules, etc. for power management in Linux. The default value of RHEL 6 is OnDemand, the CPU operates at the highest clock frequency when the system load is high, and operates at the lowest frequency when the system is idle. |
Linux Kernel Version
CPUfreq Governor has beens supported starting from Red Enterprise Linux 6.
The kernel version of RHEL 6 is 2.6.32-71.
RemoveIPC
RemoveIPC is an option added in RHEL 7.2. It is a Linux property that removes the System V IPC and POSIX IPC objects when the OS user terminates the session.
In the case of the default setting 'yes', cases of abnormal termination of the Altibase server and applications due to forced semaphore allocation and return in the Altibase environment using IPC have been reported. Even in an environment that does not use IPC, 'no' is recommended because there have also been reported that affects system performance due to RemoveIPC-related actions and system calls occurring in the kernel.
Kernel Parameter | Description | Recommended Value |
---|---|---|
RemoveIPC | Removes all IPC resources when the OS user logs out. The root user and system user are not affected by this setting. The default value is 'yes'. | no |
Linux Kernel Version
RemoveIPC is an option added in Red Hat Enterprise Linux 7.2.
The kernel version of RHEL 7.2 is 3.10.0-327.
Swappiness
This is a recommended kernel parameter to minimize the effect of disk I/O on the performance of the Altibase server when swapping occurs.
Swapping refers to the operation (swap out) of moving out the physical memory area, which is less frequently used, into the swap area in a situation where the physical memory is insufficient. The swap is to use the disk as a memory and when the swap out occurs, the system performance decreases due to DISK I/O.
Therefore, it is important to properly set the swappiness to maintain the stable and consistent performance of the Altibase server.
Kernel Parameter | Description | Recommended Value |
---|---|---|
swappiness | This can be set between 0 to 100. A low value makes the kernel use pages from page cache as much as possible, and a high value prefers to swap out less frequently used pages(cold pages)Linux for managing a car amount of memory in physical memory. | 1 |
Disabling swappiness completely increases the likelihood that the Altibase server process will be killed abnormally by the OOM Killer in low memory situations.
Recommendation '1' is a setting to minimize swapping without disabling swappiness.
The page cache is a memory area managed by Linux to improve file I/O performance.
Linux Kernel Version
Swappiness applies to all kernel versions
THP(Transparent Huge Pages)
THP is a setting adopted by Linux for managing a large amount of memory. It is a setting to automate the function of expanding a memory page of 4096 bytes in units of 2MB or 1GB.
However, in the Altibase operating environment, cases of performance issues due to memory allocation delays and fragmentation have been reported, so deactivation is recommended.
Kernel Parameter | Description | Recommended Value |
---|---|---|
THP(transparent_hugepage) | This automates the function to expand the memory page unit managed by the kernel from the existing 4K to 2M or 1G. The default value is 'always' | Never |
Linux Kernel Version
THP (Transparent Huge Pages) has been supported starting with Red Hat Enterprise Linux 6.
The kernel version of RHEL 6 is 2.6.32-71.
max_map_count
When operating a terabyte unit memory table, memory allocation may fail due to the max_map_count parameter limitation. It is recommended to set it to a sufficiently large value because it can seriously affect the operation of Altibase such as transaction failure.
Kernel Parameter | Description | Recommended Value |
---|---|---|
max_map_count | This is the maximum number of memory map areas that a process can use. In most cases, the default value 65530 is suitable, but if the user needs to map more than this file to the application, the user should increase this value. | 2147483647 |
If memory allocation fails due to this parameter limitation,
The following message may be left in the Altibase trace log altibase_boot.log.
Failed to mmap log file ( errno=ENOMEM(12), Not enough memory
In the application, an error such as Memory [iduMemMgr :: malloc] failed. may occur.
Shared Memory
This is a kernel parameter required when multiple applications need to exchange information with each other on one server.
When the communication method between Altibase server and client is IPC or IPCDA type
Two or more Altibase applications communicate over IPC
The OS provides a resource called IPC (Inter Process Communication). Among various IPC resources, the memory area used by two or more processes to exchange information is called shared memory. The shared memory can be set by the user by dividing it into one or more areas by specifying a unit, and this is called a segment.
For example, a user can set up a shared memory with one segment at 10 MB or a shared memory of 100 MB by organizing 10 segments with 10 MB. Therefore, it is necessary to set the segment-related kernel parameters such as the maximum size or number of segments.
Shared memory related parameters provided by Linux and recommended values from Altibase are as follows.
Kernel Parameter | Description | Recommended Value |
---|---|---|
shmmni | The maximum number of shared memory segments that can be created. The default value is 4096. | 4096 |
shmmax | The maximum size of one shared memory segment, in bytes. For x86 systems, the minimum setting is 268435456 bytes (256MB) and for 64-bit systems it is 2147483648 bytes (2GB). | 2147483648 |
Semaphore
This is a kernel parameter required to implement synchronization between processes when the communication method between the Altibase server and the client is IPC or IPCDA type.
Semaphore is a resource provided by the OS to restrict access to shared resources in IPC. Since the shared memory is used as a communication buffer in the IPC or IPCDA communication method, semaphore operation is used to control read/write concurrency for this resource. Depending on the semaphore operation, the process can be in waiting or in progress state. Since semaphore operations occur simultaneously, it is necessary to set the number of semaphores and the appropriate kernel parameters for the operations.
Semaphore-related parameters provided by Linux and recommended values from Altibase are as follows.
Kernel Parameter | Description | Recommended Value |
---|---|---|
semmsl | The maximum number of semaphores in a set of semaphores and must be logically equal to or less than semmns. If set too large, several semaphore IDs can monopolize the entire system semaphore | 2000 |
semmns | The maximum number of semaphores in the operating system, and 16 bytes of kernel memory are allocated per one. | 32000 |
semopm | The maximum number of operations handled by the semop system call. | 512 |
semmni | The maximum number of semaphore sets can be set within 65535 and 85 bytes of kernel memory is allocated per set. | 5029 |
How to Change Kernel Parameters
Let's learn how to check and change the settings of each kernel parameter.
CPU frequency Governor
It is recommended that the CPU frequency governor is set as performance.
How to Check Set Value
This is a verification method commonly used in RHEL 6 and 7. Normally, it is checked with the cat command. If the cpupowerutils package is installed, it can also be checked with the cpupower command.
cat command
This is verification method commonly user in RHEL 6 and 7.
CPU frequency governor setting confirmation method and output example - cat
How to check whether the CPUfreq governor driver is installed
Red Hat Enterprise Linux 6
Red Hat Enterprise Linux 7
cpupower command
How to check CPU frequency governor settings - cpupower
How to check clock speed per CPU core
Check if the clock speed of all CPU cores is set with the following command.
1. Change Immediately
Settings using the governor directive and the cpupower command can be changed while online, but initialized when the OS is restarted.
CPUfreq Governor immediate change in RHEL 6 1 - cat command
cpupower
For systems with tuned system tools enabled, refer to [RHEL 7 CPUfreq Governor Permanently Applied - tuned].
How to check the tuned system tool activation
Permanent Application
This is a way to keep the settings even after restarting the OS.
Tuned
Refer to [RHEL 7 CPUfreq Governor permanently applied - tuned].
rc.local
Used when the tuned service is disabled.
How to apply RHEL 6 CPUfreq Governor permanently 2 - rc.local
Red Hat Enterprise Linux 7
This is how to change the CPU frequency governor in Red Hat Enterprise Linux 7.
Change immediately
Cpupower
Configuration changes using the cpupower command are initialized when the OS is restarted.
Apply RHEL 7 CPUfreq Governor settings immediately - cpupower.
Permanent application
tuned
Use the throughput-performance or latency-performance profiles provided by Linux. Using these two profiles, it can see the following effects:
CPUfreq governor is set to performance
CPU clock speed is fixed as maximum
For reference, the default profile of Red Hat Enterprise Linux 7 is throughput-performance.
There are two ways to set the throughput-performance or latency-performance profile.
First method: Include the throughput-performance profile in the active profile.
Permanent application of RHEL 7 CPUfreq Governor-How to include a throughput-performance profile in active tuned profile
Second method: Change the active profile to throughput-performance.
Permanent application of RHEL 7 CPUfreq Governor - Example of changing the active profile to throughput-performance
RemoveIPC applies to Red Hat Enterprise Linux 7.2 and later, and the recommended value is 'no'.
How to Check Set Value
Make sure RemoveIPC = no is set in the logind.conf file.
Check RemoveIPC settings
How to Change the Settings
Red Hat Enterprise Linux 7
Change Immediate
RemoveIPC does not provide a way to change immediately on Linux
Permanent Application
Open the /etc/systemd/logind.conf file with an editor and change RemoveIPC = no.
How to change RemoveIPC
Restart the OS or execute the following command to apply the changes.
Apply after changing RemoveIPC
swappiness
Check the current setting value, and if the setting is not recommended, change it by referring to the guide below.
How to Check Set Value
Checking the settings is the same regardless of the Linux version. There are two ways to do this.
Use cat
How to check swappiness setting 1 - cat
Use sysctl
How to check swappiness setting 2 - sysctl
How to Change the Settings
Red Hat Enterprise Linux 6
This is how to change swappiness in Red Hat Enterprise Linux 6.
Change Immediately
Use the echo or sysctl command.
How to change RHEL 6 swappiness immediately 1 - echo
Permanent Application
It can be configured in two ways, sysctl.conf and rc.local, so they all apply the same way.
sysct.conf
How to permanently apply RHEL 6 swappiness 1 - sysctl
rc.local
How to permanently apply RHEL 6 swappiness 2 - rc.local
This is how to change swappiness in Red Hat Enterprise Linux 7.
Change Immediately
Use the echo or sysctl command.
How to change RHEL 7 swappiness immediately 1 - echo
Permanent Application
It can be set in two ways, tuned profile and sysctl.conf, so they are all applied identically.
tuned
How to permanently apply RHEL 7 swappiness - tuned
Restart the OS to see the changes. Restarting the OS may be performed at once after all kernel parameters are changed.
THP
Check the current setting value, and if the setting is not recommended, change it by referring to the guide below.
How to Check Set Value
Checking the settings is the same regardless of the Linux version.
How to Change the Settings
Red Hat Enterprise Linux 6
This is how to disable THP in Red Hat Enterprise Linux 6.
Change Immediately
The command below stops only for new TPH creating and using. Since the previously created THP is not released, you must restart the OS with THP disabled in order to completely remove it.
Permanent Application
Applies to both the grub.conf file and the rc.local file.
/etc/grub.conf
Add the transparent_hugepage=never setting to the grub.conf file.
/etc/rc.d/rc.local
Add the following to the rc.local file.
Change Immediately
In RHEL 7, the THP setting cannot be changed while the OS is running.
Permanent Application
For Red Hat Enterprise Linux 7, you can enable it with grub and tuned settings, so disable it in all configurations.
grub
- Add transparent_hugepage=never to the GRUB_CMDLINE_LINUX entry in the /etc/default/grub file.
On BIOS-based machines
On UEFI-based machines
If tuned service is activated, set THP deactivation in tuned profile.
For reference, the default tuned profile of Red Hat Enterprise Linux 7 is throughput-performance, and THP activation is the default setting.
Below is how to disable THP in active tuned profile.
There is also a way to register a new tuned profile.
https://www.thegeekdiary.com/centos-rhel-7-how-to-disable-transparent-huge-pages-thp/
max_map_count
Check the current setting value, and if the setting is not recommended, change it by referring to the guide below.
How to Check Set Value
Checking the settings is the same regardless of the Linux version. There are two ways to do this.
Use cat
How to check max_map_count setting 1 - cat
Use sysctl
How to Change the Setting
Red Hat Enterprise Linux 6
This is how to change the max_map_count parameter setting in Red Hat Enterprise Linux 6.
Change Immediately
Use the sysctl command.
How to change RHEL 6 max_map_count immediately - sysctl
Permanent Application
It can be configured in two ways, sysctl.conf and rc.local, so they all apply the same way.
sysct.conf
RHEL 6 max_map_count Permanent application method 1 - sysctl
rc.local
This is how to change max_map_count in Red Hat Enterprise Linux 7.
Change Immediately
Use the sysctl command.
How to change RHEL 7 max_map_count immediately - sysctl
Permanent Application
It can be set in two ways, tuned profile and sysctl.conf, so they are all applied identically.
tuned
How to permanently apply RHEL 7 max_map_count - tuned
/etc/sysctl.conf
How to permanently apply RHEL 7 max_map_count - sysctl.conf
How to Check Set Value
lpcs command
How to check shared memory and semaphore 1 - Using ipcs command
sysctl command
How to Change the Settings
Change Immediately
Use the echo command.
Immediate change shared memory and semaphores
Permanent Application
Add to /etc/sysctl.conf file.
Shared memory and semaphore permanent application - /etc/sysctl.conf
User Setting
This section describes the user settings required to install and operate the Altibase server on Linux. A user is an OS user, and is a user who installs the Altibase server and runs the Altibase server process.
The user login configuration file in the bash shell is .bash_profile. The user configuration file differs depending on the shell, but it is described based on the Linux default shell because it is a bash shell.
The user setting is divided into the following two categories:
Resource limitation
Environment variable
Resource Limitation
Linux provides settings to limit system resources such as CPU, memory, and files. Proper configuration is necessary because the purpose of preventing a specific user from monopolizing system resources, or the limitation of file creation or memory allocation, has a fatal effect on the operation of the Altibase server.
The resource items and recommended values in the Altibase server operating environment are as follows.
ulimit command | Items in limits.conf | Description | Recommended Value |
---|---|---|---|
data seg size (kbytes, -d) | data | The maximum memory size of the process data area | unlimited |
file size (blocks, -f) | fsize | The maximum size of files that can be created | unlimited |
open files (-n) | nofile | The maximum number of open file descriptors a process can open | 1048576 |
max memory size (kbytes, -m) | rss | The maximum amount of available memory | unlimited |
virtual memory (kbytes, -v) | as | The maximum amount of virtual memory available | unlimited |
max user processes (-u) | nproc | The maximum number of processes (including threads) that the user can run | unlimited |
Related Error Message
Insufficient max user processes
Failed to create a thread object.
resource temporarily unavailable
Insufficient open files
Too many open files
View and Change Resource Settings
Resource limits are set for each user, but apply individually to user processes.
To reflect the changed resource limit settings to the Altibase server, the Altibase server must be restarted.
How to Check Set Value
This command checks the resource limit setting value.
If the desired settings are not applied to the Altibase server process, the Altibase server must be restarted.
How to Change the Settings
Execute ulimit command
ulimit is a command to set resource limits. The ulimit configuration command is added to the .bash_profile of the configuration file of the OS user who installs and runs the Altibase server.
Apply the configuration file (.bash_profile)
Apply ulimit setting with the following command.
When applying the configuration file, the following error may occur.
This is an error caused by Hard-Limit.
Hard-Limit & Soft-Limit
If Hard-Limit is smaller than the value that user wants to set as ulimit, 'cannot modify limit' error occurs.
How to check Hard-Limit
Change /etc/security/limits.conf
Hard-Limit changes require root privileges. Add the following setting to the limits.conf file and save it.
Hard-Limit configuration example - OS user name is altibase
Log in as the OS user and perform step 2 again.
Environment Variables
This is an environment variable to be set after installing the Altibase server.
Classification | Environment Variable | Description | Setting Value |
---|---|---|---|
Required (Auto Setting) | ALTIBASE_HOME | Specifies the path where Altibase is installed | Depends on the environment |
Required (Auto Setting) | PATH | Finds the location Altibase's utilities and shell scripts | $ALTIBASE_HOME/bin |
Required (Auto Setting) | LD_LIBRARY_PATH | Finds the location of the Altibase dynamic library | $ALTIBASE_HOME/lib |
Required (Auto Setting) | CLASSPATH | Finds the location of the Java Class file | $ALTIBASE_HOME/lib |
Required (Manual Setting) | ALTIBASE_NLS_USE | Sets the Altibase client character set. Set the same as the Altibase server character set. | Same as Altibase server character set |
Required (Manual Setting) | LANG | Defines the user's system locale | It is affected by the Altibase server character set. |
Select (Manual Setting) | MALLOC_ARENA_MAX |
| - |
This environment variable is optional.
In general, consider keeping the default value and setting it smaller than the default value if a memory issue is found.
Since this environment variable affects the performance and memory usage of the Altibase server process according to the set value, it is difficult to recommend the same value collectively.
How to Set Environment Variables
How to Check the Set Value
Check if the required environment variables are set correctly.
env command
The env result prints all environment variables set for the session.
echo command
The specified environment variable settings are output. If the value is not output, it means that the environment variable is not set.
How to Change the Settings
This is a method of setting the ALTIBASE_NLS_USE and LANG environment variables that must be manually set among the required environment variables.
Check the Altibase server character set
Set environment variables in .bash_profile file
Environment variables are set in units of OS user sessions. Therefore, it must be added to the user configuration file .bash_profile to be applied every time an OS user connects.
The table below shows the ALTIBASE_NLS_USE and LANG environment variable settings according to the Altibase server character set.
Altibase Server Character Set | ALTIBASE_NLS_USE | LANG |
---|---|---|
MS949 | MS949 | ko_KR.euckr |
KOS16KSC5601 | KOS16KSC5601 | ko_KR.euckr |
UTF88 | UTF8 | Ko_KR.utf8 |
Environment variable setting example - added to .bash_profile
Apply to the configuration file .bash_profile
Apply the environment variable added with the following command.
Summary
Category | Recommendation setting | How to check | ||
---|---|---|---|---|
Kernel Parameter | CPU frequency Governor | performance | cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor | sort -u | |
CPU core clock speed is fixed at maximum | grep MHz /proc/cpuinfo | sort -u | |||
RemoveIPC | no | grep RemoveIPC /etc/systemd/logind.conf | ||
swappiness | 1 | cat /proc/sys/vm/swappiness or | ||
THP | never | cat /sys/kernel/mm/transparent_hugepage/enabled | ||
All 0 besides Hugepagesize | grep -i huge /proc/meminfo | |||
Including transparent_hugepage=never | cat /proc/cmdline | |||
max_map_count | 2147483647 | cat /proc/sys/vm/max_map_count | ||
Shared Memory | shmmni | 4096 | ipcs -m -l sysctl -a | grep -e kernel.shmmax -e kernel.shmmni | |
shmmax | 2147483648 | |||
Semaphore | semmsl | 2000 | ipcs -s -l sysctl -a | grep -kernel.sem | |
semmns | 32000 | |||
semopm | 512 | |||
semmni | 5029 | |||
OS User Resource Limitation | data seg size | (kbytes, -d) | unlimited | ulimit -a |
file size | (blocks, -f) | unlimited | ||
open files | (-n) | 1048576 | ||
max memory size | (kbytes, -m) | unlimited | ||
virtual memory | (kbytes, -v) | unlimited | ||
max user processes | (-u) | unlimited | ||
OS User Environment Variable | ALTIBASE_HOME | Altibase installation path (absolute path) | env | |
PATH | $ALTIBASE_HOME/bin | |||
LD_LIBRARY_PATH | $ALTIBASE_HOME/lib | |||
CLASSPATH | $ALTIBASE_HOME/lib | |||
ALTIBASE_NLS_USE | Same as Altibase server character set | |||
LANG | Based on Altibase server character set |
Others
Red Hat Enterprise Linux Recommended Swap Size
Red Hat Linux recommends the following for Swap sizing.
In the past, twice as much swap space as physical memory was recommended, but today with terabytes of memory, the last recommendation is not practical.
For systems with more than 140 logical processors or systems with more than 3 TB of RAM, a minimum swap space of 100 GB is recommended.
For details, refer to the Red Hat CUSTOMER PORTAL page.
What is the recommended swap size for Red Hat platforms?
Force termination of Altibase server process by timeout setting when registering Altibase startup service with systemd
Note for Linux distributions using RHEL 7 or higher or systemd.
If there is a timeout setting in the systemd service configuration file, there may be a phenomenon in which the Altibase server process is forcibly terminated by the OS while the Altibase server process is running during the OS boot process.
- TimeoutStartSec or TimeoutSec
In this case, the following message is left in the system log (messages).
Jun 3 07:25:26 r-sky-ex altibase: [SM] Recovery Phase - 2 : Loading Database
Jun 3 07:26:53 r-sky-ex systemd: altibase.service start operation timed out. Terminating.
Jun 3 07:26:53 r-sky-ex systemd: Failed to start altibase 7.1.
Jun 3 07:26:53 r-sky-ex systemd: Unit altibase.service entered failed state.
Jun 3 07:26:53 r-sky-ex systemd: altibase.service failed.
- Memory data and memory index is large or
- When Restart Recovery is in progress while Altibase is running
TimeoutStartSec or TimeoutSec setting value must be set enough according to the operating environment or set to 0 (timeout disabled).
Similarly, there is a TimeoutStopSec setting.
Please refer to 'man systemd.service' for more details.
SYS area CPU usage increase in the server where'Symantec Endpoint Protection (SEP) for Linux' is installed
It has been found that the CPU usage of the SYS area of the Altibase server process is increased by the Symantec Endpoint Protection process.
As a result of vtune analysis, as the number of Altibase sessions increases, the CPU usage of the SYS area increases significantly by system calls select() and write().
There is a case where the cause was not identified by Broadcom, and the vaccine program was changed. (As of June 2020)
The server environment where the symptoms are reported is as follows.
- Red Hat Enterprise Linux 7
- Symantec Endpoint Protection(SEP) for Linux