Skip to content
Contents

Linux Setup Guide for Altibase#

Overview#

This document describes the kernel parameters and OS user environment settings required to run Altibase reliably on Linux. For each item, it first explains the recommended value and the reason for it, and then shows how to check and change the current setting.

This document is based on Altibase 7.1 and Red Hat Enterprise Linux (RHEL) 6 or later.

Refer also to Altibase 7.1 Installation Guide - Appendix A. Installation Prerequisites and Supported Platforms by Altibase Version.

Info

For errors and improvements related to this document, please contact the technical support portal or technical support center.

Info

This document is provided for informational purposes only and is subject to change without prior notice. It may contain errors, and Altibase makes no express or implied warranties of any kind, including but not limited to warranties of merchantability or fitness for a particular purpose.

The development, release, and timing of any features or functionality described for Altibase products in this document are at the sole discretion of Altibase.

Altibase may hold patents, trademarks, copyrights, or other intellectual property rights related to the contents of this document.

Linux Compatibility#

Although there are many Linux distributions, Altibase determines compatibility by the glibc version, not by the distribution or kernel version.

glibc Compatibility Version#

For the OS and glibc versions that each Altibase version supports, see Supported Platforms by Altibase Version.

Note

To install Altibase on a RHEL 9 family distribution (RHEL 9, Rocky Linux 9, Oracle Linux 9, AlmaLinux 9, and so on), you need the libxcrypt-compat package.

Altibase uses libcrypt.so.1. On the RHEL 9 family, the default libxcrypt package provides only libcrypt.so.2, and the compatibility package libxcrypt-compat provides libcrypt.so.1. Because a minimal installation may not include this package, check whether it is installed before installing Altibase, and install it if it is missing.

# Check whether libxcrypt-compat is installed
$ rpm -q libxcrypt-compat

# Install it if it is not installed
$ sudo dnf install libxcrypt-compat

Note

RHEL 8 changed the ncurses library version to 6.1. To run iSQL and iLoader, you must therefore create the libncurses.so.5 and libtinfo.so.5 symbolic links.

For details, see Altibase 7.1 Installation Guide - Appendix A. Installation Prerequisites.

Checking the glibc Version#

Check the glibc version with the following commands.

# Red Hat family
$ rpm -q glibc

# Debian family (Ubuntu)
$ ldd --version

Kernel Parameters#

You can change a setting temporarily or permanently. A temporary change takes effect immediately, but the original value returns when the OS restarts. A permanent change persists across OS restarts, and you must restart the OS to apply it completely. When you change several parameters permanently, you can restart the OS only once after changing all of them.

If you use the tuned service on RHEL 7 or later, you may also need to modify the tuned profile for a permanent change. If the tuned service is stopped or no profile is active, skip the tuned steps.

Tip

Updating the tuned package can overwrite the default profiles under /usr/lib/tuned. Instead of modifying a default profile directly, consider creating a custom profile in /etc/tuned/{profile_name}/tuned.conf that inherits the default profile with include.

CPU Frequency Governor#

Altibase requires maximum throughput and minimum response time, so the CPU clock speed must always stay at its maximum. However, with ondemand, the default CPUfreq governor on RHEL 6, there have been cases where the latency of frequency changes prevented Altibase from performing consistently. We therefore recommend setting the governor to performance or disabling the feature altogether.

Kernel Parameter Description Recommended Value
CPU frequency governor (CPUfreq governor) A governor that adjusts CPU frequency scaling rules for power management on Linux. performance

Checking the CPU Frequency Governor Setting#

Checking with the cat Command#
$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor | sort -u
performance

The following output means that no CPUfreq driver is installed. In this case, you do not need to change the CPU frequency governor setting.

cat: /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor: No such file or directory
Checking with the cpupower Command#

If the cpupowerutils package is installed, you can also check the setting with the cpupower command.

$ cpupower frequency-info --policy

The following is an example of the output. The output can differ depending on the version of the cpupower command.

analyzing CPU 0:
  current policy: frequency should be within 1.20 GHz and 3.60 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.

The following output means that no CPUfreq driver is installed. In this case, you do not need to consider the CPU frequency governor setting.

analyzing CPU 0:
  Unable to determine current policy
Checking the Clock Speed of Each CPU Core#

Check that all CPU cores run at the same clock speed.

$ grep MHz /proc/cpuinfo | sort -u

Changing the CPU Frequency Governor Temporarily#

Change the governor value directly or use the cpupower command.

# Change the governor value directly
$ echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

# Use the cpupower command
$ cpupower frequency-set -g performance

Changing the CPU Frequency Governor Permanently#

Using rc.local (RHEL 6)#

Add the following line to the /etc/rc.local file.

echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
Using a udev Rule (RHEL 7 or Later)#

Create the /etc/udev/rules.d/99-cpufreq.rules file or open the existing file.

$ vi /etc/udev/rules.d/99-cpufreq.rules

Add the following line.

ACTION=="add", SUBSYSTEM=="cpu", KERNEL=="cpu[0-9]*", ATTR{cpufreq/scaling_governor}="performance"

Reload the udev rules.

$ sudo udevadm control --reload-rules
$ sudo udevadm trigger --subsystem-match=cpu
Using tuned (RHEL 7 or Later)#

Check the active tuned profile.

$ tuned-adm active
Current active profile: virtual-guest

The throughput-performance and latency-performance profiles that Linux provides by default set the CPUfreq governor to performance and fix the CPU clock speed at its maximum. The following example changes the active virtual-guest profile so that it inherits one of these profiles.

$ cd /usr/lib/tuned/virtual-guest
$ vi tuned.conf

Add the following to the [main] section.

[main]
include=throughput-performance

Apply the modified profile.

$ tuned-adm profile 'profile_name'

Instead of modifying the profile, you can also switch the active profile to throughput-performance or latency-performance.

$ tuned-adm profile throughput-performance

RemoveIPC#

RemoveIPC is a systemd-logind option added in RHEL 7.2. When it is enabled, the OS removes System V IPC and POSIX IPC objects when an OS user ends a session.

With the default value yes, there have been cases where the OS forcibly released semaphores in an Altibase environment that uses IPC, causing Altibase and applications to terminate abnormally. Even in environments that do not use IPC, there have been cases where the kernel's RemoveIPC operations and system calls affected system performance. We therefore recommend setting it to no.

Kernel Parameter Description Recommended Value
RemoveIPC Removes all IPC resources when an OS user logs out.
It does not apply to the root user and system users. The default value is yes.
no

Checking the RemoveIPC Setting#

Check the contents of the logind.conf file.

$ grep RemoveIPC /etc/systemd/logind.conf
RemoveIPC=no

Changing RemoveIPC Permanently#

RemoveIPC does not support a temporary change.

Open the /etc/systemd/logind.conf file in an editor.

$ vi /etc/systemd/logind.conf

Add RemoveIPC=no or change the existing value.

#  This file is part of systemd.
# ... (omitted) ...
[Login]
# ... (omitted) ...
RemoveIPC=no

Restart the OS or run the following command to apply the change.

$ systemctl restart systemd-logind.service

Swappiness#

Swapping is the operation in which the kernel moves rarely used areas of physical memory to the swap area on disk (swap out) when physical memory runs short. Swapping out causes disk I/O, which degrades system performance. To keep Altibase performance stable and consistent, you must therefore set swappiness appropriately.

Kernel Parameter Description Recommended Value
swappiness With a low value, the kernel reclaims pages from the page cache first. With a high value, it swaps out rarely used (cold) pages from physical memory. 1

The recommended value 1 minimizes swapping without disabling it. If you disable swapping completely by setting swappiness to 0, the OOM Killer is more likely to kill the Altibase process when memory runs short.

Checking the Swappiness Setting#

Check the vm.swappiness setting in the /proc/sys/vm/swappiness file or with the sysctl command.

# Check the /proc/sys/vm/swappiness file
$ cat /proc/sys/vm/swappiness
1

# Use the sysctl command
$ sysctl vm.swappiness
vm.swappiness = 1
RHEL 8: Checking vm.force_cgroup_v2_swappiness#

In a cgroup v1 environment on RHEL 8, the vm.swappiness setting has little effect on swap behavior, so unexpected swapping can occur. To prevent this, you must also check the setting that Red Hat recommends (Red Hat Solution 6785021).

Check the vm.force_cgroup_v2_swappiness value with the sysctl command. The recommended value is 1.

$ sysctl vm.force_cgroup_v2_swappiness
vm.force_cgroup_v2_swappiness = 1

The following output means that the system does not support the vm.force_cgroup_v2_swappiness parameter. In this case, check the memory.swappiness value of each cgroup.

sysctl: cannot stat /proc/sys/vm/force_cgroup_v2_swappiness: No such file or directory
RHEL 8: Checking memory.swappiness of Each cgroup#

On RHEL 8 versions that do not support vm.force_cgroup_v2_swappiness, the memory.swappiness value of every cgroup must be 1.

$ find /sys/fs/cgroup/memory -name memory.swappiness -exec cat {} \; | sort -u
1

If the output also contains values other than 1, as shown below, you must change the memory.swappiness value of every cgroup to 1.

1
60

Changing Swappiness Temporarily#

$ sysctl -w vm.swappiness=1

Changing Swappiness Permanently#

Modifying the sysctl Configuration File#

Open the /etc/sysctl.conf file or the /etc/sysctl.d/99-sysctl.conf file. If /etc/sysctl.d/99-sysctl.conf does not exist, create it.

$ vi /etc/sysctl.conf
# or
$ vi /etc/sysctl.d/99-sysctl.conf

Add the following setting or change the existing value.

vm.swappiness = 1

On RHEL 8, also add the following setting to /etc/sysctl.conf and /etc/sysctl.d/99-sysctl.conf.

vm.force_cgroup_v2_swappiness = 1
RHEL 8: Changing memory.swappiness of Each cgroup#

Support for the vm.force_cgroup_v2_swappiness parameter depends on the RHEL 8 minor version. If your version does not support it, we recommend contacting your OS vendor to apply Workaround #2 in Red Hat Solution 6785021.

Using tuned (RHEL 7 or Later)#

Check the active tuned profile.

$ tuned-adm active
Current active profile: throughput-performance

The following example changes the settings of the active throughput-performance profile.

$ cd /usr/lib/tuned/throughput-performance
$ vi tuned.conf

If the [sysctl] section contains vm.swappiness, change its value to 1. Otherwise, leave the section as it is.

[sysctl]
vm.swappiness=1

If RHEL 8 supports vm.force_cgroup_v2_swappiness, also add the following setting to the [sysctl] section.

[sysctl]
vm.force_cgroup_v2_swappiness=1

Apply the modified profile.

$ tuned-adm profile 'profile_name'

THP#

THP (Transparent Huge Pages) is a Linux feature that automatically enlarges memory pages from 4 KB to 2 MB or 1 GB to manage large amounts of memory efficiently. However, there have been performance problems in Altibase environments caused by memory allocation delays and memory fragmentation due to THP, so we recommend disabling it.

Kernel Parameter Description Recommended Value
THP (transparent_hugepage) Automatically enlarges the memory page size that the kernel manages from 4 KB to 2 MB or 1 GB. The default value is always. never

Checking the THP Setting#

Check all three of the following items to determine whether THP is disabled.

Checking the Current THP Status#
# RHEL 6
$ cat /sys/kernel/mm/redhat_transparent_hugepage/enabled
$ cat /sys/kernel/mm/redhat_transparent_hugepage/defrag

# RHEL 7 or later
$ cat /sys/kernel/mm/transparent_hugepage/enabled
$ cat /sys/kernel/mm/transparent_hugepage/defrag

The following is the output when THP is set to the recommended value (never). The value in square brackets ([]) is the current setting.

always madvise [never]
Checking /proc/meminfo#
$ grep -i huge /proc/meminfo

The following is an example of the output. All values except Hugepagesize must be 0.

AnonHugePages:         0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Checking the Boot Loader Settings#
$ cat /proc/cmdline

The following is an example of the output. Check that it contains transparent_hugepage=never and transparent_hugepage.defrag=never.

BOOT_IMAGE=/vmlinuz-3.10.0-862.el7.x86_64 root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet transparent_hugepage=never transparent_hugepage.defrag=never

Changing THP Temporarily#

To disable THP completely, we recommend changing the defrag setting together with enabled. If defrag is always, the kernel tries to compact fragmented memory when it allocates huge pages even while THP is disabled, which can waste CPU and degrade performance.

The following commands only stop the creation and use of new huge pages. Huge pages that already exist remain, so to remove them completely you must restart the OS with THP disabled.

# RHEL 6
$ echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled
$ echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag

# RHEL 7 or later
$ echo never > /sys/kernel/mm/transparent_hugepage/enabled
$ echo never > /sys/kernel/mm/transparent_hugepage/defrag

Changing THP Permanently#

Changing the GRUB Settings (RHEL 6)#

Open the /etc/grub.conf file.

$ vi /etc/grub.conf

Add transparent_hugepage=never transparent_hugepage.defrag=never at the end of the kernel line.

        kernel /vmlinuz-2.6.32-504.el6.x86_64 ro root=/dev/mapper/vg_os-lv_os rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=vg_os/lv_os KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet transparent_hugepage=never transparent_hugepage.defrag=never
        initrd /initramfs-2.6.32-504.el6.x86_64.img
Changing the GRUB Settings (RHEL 7 or Later)#

Open the /etc/default/grub file.

$ vi /etc/default/grub

Add transparent_hugepage=never transparent_hugepage.defrag=never at the end of the GRUB_CMDLINE_LINUX entry.

GRUB_CMDLINE_LINUX="nomodeset crashkernel=auto rd.lvm.lv=vg_os/lv_root rd.lvm.lv=vg_os/lv_swap rhgb quiet transparent_hugepage=never transparent_hugepage.defrag=never"
GRUB_DISABLE_RECOVERY="true"

Regenerate the GRUB configuration file.

# BIOS-based systems
$ grub2-mkconfig -o /boot/grub2/grub.cfg

# UEFI-based systems
$ grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg

Restart the OS to apply the change.

Tip

On RHEL 8 or later, you can also use the grubby command to add the options to the boot parameters of all kernels at once.

$ grubby --update-kernel=ALL --args="transparent_hugepage=never transparent_hugepage.defrag=never"
Using rc.local (RHEL 6)#

Open the /etc/rc.d/rc.local file.

$ vi /etc/rc.d/rc.local

Add the following lines at the end of the file.

if test -f /sys/kernel/mm/redhat_transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/redhat_transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag
fi
Using tuned (RHEL 7 or Later)#

Check the active tuned profile.

$ tuned-adm active
Current active profile: throughput-performance

The following example changes the settings of the active throughput-performance profile.

$ cd /usr/lib/tuned/throughput-performance
$ vi tuned.conf

If the [vm] section contains transparent_hugepage, change its value to never. Otherwise, leave the section as it is.

[vm]
transparent_hugepage=never

Apply the modified profile.

$ tuned-adm profile 'profile_name'

max_map_count#

When you operate memory tables in the terabyte range, memory allocation can fail because of the max_map_count limit. Because this can seriously affect Altibase operation, for example by causing transactions to fail, we recommend setting it to a sufficiently large value.

Kernel Parameter Description Recommended Value
max_map_count The maximum number of memory map areas that a process can use. The default value is 65530. 2147483647

When memory allocation fails because of this limit, Altibase can write the following message to the trace log altibase_boot.log.

Failed to mmap log file ( errno=ENOMEM(12), Not enough memory

Applications can receive the following error.

Memory [iduMemMgr::malloc] failed.

Checking the max_map_count Setting#

Check the setting with the cat command or the sysctl command.

# Use the cat command
$ cat /proc/sys/vm/max_map_count

# Use the sysctl command
$ sysctl vm.max_map_count

Changing max_map_count Temporarily#

$ sysctl -w vm.max_map_count=2147483647

Changing max_map_count Permanently#

Modifying the sysctl Configuration File#

Open the /etc/sysctl.conf file.

$ vi /etc/sysctl.conf

Add the following setting or change the existing value.

vm.max_map_count = 2147483647
Using rc.local (RHEL 6)#

Open the /etc/rc.d/rc.local file.

$ vi /etc/rc.d/rc.local

Add the following line at the end of the file.

echo 2147483647 > /proc/sys/vm/max_map_count
Using tuned (RHEL 7 or Later)#

Check the active tuned profile.

$ tuned-adm active
Current active profile: throughput-performance

The following example changes the settings of the active throughput-performance profile.

$ cd /usr/lib/tuned/throughput-performance
$ vi tuned.conf

If the [sysctl] section contains vm.max_map_count, change its value to 2147483647. Otherwise, leave the section as it is.

[sysctl]
vm.max_map_count=2147483647

Apply the modified profile.

$ tuned-adm profile 'profile_name'

Shared Memory and Semaphores#

The OS provides IPC (Inter Process Communication) resources so that multiple processes on a server can exchange information. Shared memory and semaphores are IPC resources. Altibase needs them when Altibase and clients communicate using IPC or IPCDA, or when two or more Altibase applications communicate using IPC.

Altibase supports IPCDA from version 7. For details on communication methods, see Altibase 7.1 Administrator's Manual - 12. Server/Client Communication.

Shared Memory#

Shared memory is the IPC resource that processes use as a memory area for exchanging information. You can divide shared memory into one or more areas called segments. You must therefore set the maximum size and maximum number of segments with kernel parameters.

The shared memory kernel parameters on Linux and the values that Altibase recommends 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.
The minimum setting is 268435456 bytes (256 MB) on x86 systems and 2147483648 bytes (2 GB) on 64-bit systems.
2147483648

Semaphores#

A semaphore is a resource that the OS provides to restrict access to shared resources in IPC. Because IPC and IPCDA use shared memory as the communication buffer, Altibase controls concurrent reads and writes on the buffer with semaphore operations. Semaphore operations occur concurrently in large numbers, so you must set the kernel parameters according to the number of semaphores and operations.

The semaphore kernel parameters on Linux and the values that Altibase recommends are as follows.

Kernel Parameter Description Recommended Value
semmsl The maximum number of semaphores in one semaphore set. It must not be greater than semmns.
If you set it too high, a few semaphore IDs can monopolize the semaphores of the whole system.
2000
semmns The maximum number of semaphores in the whole system. 32000
semopm The maximum number of operations that one semop system call processes. 512
semmni The maximum number of semaphore sets. You can set it up to 65535. 5029

Checking the Shared Memory and Semaphore Settings#

Checking with the ipcs Command#

Check the shared memory kernel parameter settings.

$ ipcs -m -l
------ Shared Memory Limits --------
max number of segments = 4096                         # shmmni (recommended: 4096)
max seg size (kbytes) = 2097152                       # shmmax (recommended: 2097152)
max total shared memory (kbytes) = 137438953472
min seg size (bytes) = 1

Check the semaphore kernel parameter settings.

$ ipcs -s -l
------ Semaphore Limits --------
max number of arrays = 5029                           # semmni (recommended: 5029)
max semaphores per array = 2000                       # semmsl (recommended: 2000)
max semaphores system wide = 32000                    # semmns (recommended: 32000)
max ops per semop call = 512                          # semopm (recommended: 512)
semaphore max value = 32767
Checking with the sysctl Command#
$ sysctl kernel.shmmax kernel.shmmni kernel.sem
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 2000        32000   512     5029

Changing Shared Memory and Semaphores Temporarily#

# Shared memory settings
$ echo 4096 > /proc/sys/kernel/shmmni
$ echo 2147483648 > /proc/sys/kernel/shmmax

# Semaphore settings (in the order semmsl semmns semopm semmni)
$ echo 2000 32000 512 5029 > /proc/sys/kernel/sem

Changing Shared Memory and Semaphores Permanently#

Open the /etc/sysctl.conf file.

$ vi /etc/sysctl.conf

Add the following settings or change the existing values.

kernel.shmmni = 4096
kernel.shmmax = 2147483648
kernel.sem = 2000        32000   512     5029

User Environment#

This chapter describes the user environment settings required to install and operate Altibase on Linux: resource limits and environment variables. Here, the user means the OS user who installs Altibase and runs the Altibase process.

The user environment configuration file differs by shell. This chapter is based on bash, the default shell on Linux, whose user login configuration file is .bash_profile.

Resource Limits#

Linux provides resource limits to prevent a particular user from monopolizing system resources such as CPU, memory, and files. However, if these limits cause file creation or memory allocation to fail, Altibase operation can be severely affected, so you must set them appropriately.

The resources and values recommended for an Altibase operating environment are as follows.

Resource (ulimit Output Item) ulimit Option limits.conf item Description Recommended Value
data seg size (kbytes) -d data Maximum memory size of the process data segment unlimited
file size (blocks) -f fsize Maximum size of a file that can be created unlimited
open files -n nofile Maximum number of file descriptors that one process can open 1048576
max memory size (kbytes) -m rss Maximum size of memory that can be used unlimited
virtual memory (kbytes) -v as Maximum size of virtual memory that can be used unlimited
max user processes -u nproc Maximum number of processes (including threads) that a user can run unlimited

If the following error messages appear while Altibase is running, check the resource limit settings.

# When max user processes is insufficient
Failed to create a thread object.
resource temporarily unavailable

# When open files is insufficient
Too many open files

Checking the Resource Limit Settings#

Check the user's resource limit settings with the following commands.

# Without the -S or -H option, ulimit prints the soft limits.
$ ulimit -a

# Print the hard limits.
$ ulimit -Ha

Check the resource limits applied to the running Altibase process with the following command. Because the OS applies resource limits when a process starts, you must restart Altibase for changed settings to take effect.

$ cat /proc/$(ps -ef | grep 'altibase -p' | grep -v grep | awk '{print $2}')/limits

Changing the Resource Limits#

ulimit is the command that sets resource limits. Add ulimit commands to the .bash_profile of the OS user who installs and runs Altibase.

# Add to .bash_profile: user resource limits
# For Resource Limitation
ulimit -d  unlimited  # data segment size
ulimit -f  unlimited  # file size
ulimit -n  1048576    # file descriptor(open files)
ulimit -m  unlimited  # max memory size(rss)
ulimit -v  unlimited  # virtual memory
ulimit -u  unlimited  # user process

Apply .bash_profile with the following command.

$ . ~/.bash_profile
When the cannot modify limit Error Occurs#

The following error can occur when you apply .bash_profile.

-bash: ulimit: open files: cannot modify limit: Operation not permitted
-bash: ulimit: max user processes: cannot modify limit: Operation not permitted

The hard limit causes this error. The hard limit is the maximum resource limit that a regular OS user can set, and the soft limit is the resource limit actually applied to the user. If the value you set with ulimit is greater than the hard limit, the cannot modify limit error occurs.

Check the hard limits with the following command.

# The -H option means the hard limit.
$ ulimit -H -u -n
max user processes              (-u) 1024
open files                      (-n) 4096

Changing the hard limits requires root privileges. Add the following settings to the /etc/security/limits.conf file and save it. The following example is for an OS user named altibase.

# <domain>      <type>  <item>         <value>
altibase         -     nofile          1048576
altibase         -     nproc           unlimited

Log in again as the OS user and apply .bash_profile again.

Environment Variables#

The environment variables to set after installing Altibase are as follows.

Category Setting Method Environment Variable Description Value
Required Automatic ALTIBASE_HOME Specifies the Altibase installation path. Depends on the environment
Required Automatic PATH Specifies the location of Altibase utilities and shell scripts. $ALTIBASE_HOME/bin
Required Automatic LD_LIBRARY_PATH Specifies the location of the Altibase shared libraries. $ALTIBASE_HOME/lib
Required Automatic CLASSPATH Specifies the location of Java class files. $ALTIBASE_HOME/lib
Required Manual ALTIBASE_NLS_USE Specifies the character set of the Altibase client.
Set it to the same value as the Altibase character set.
Same as the Altibase character set
Required Manual LANG Specifies the user's system locale. Depends on the Altibase character set
Optional Manual MALLOC_ARENA_MAX A feature added in RHEL 6 to reduce performance problems caused by memory contention between threads in multithreaded applications.
The default value in a 64-bit environment is the number of CPU cores * 8.
-

Normally, keep the default value of MALLOC_ARENA_MAX. Because this value affects the performance and memory usage of processes, it is difficult to recommend one value for every environment. However, because the default value is proportional to the number of CPU cores, the VSZ of a process can become excessively large on a system with many cores. If you find a memory problem like this, consider setting a value smaller than the default.

Checking the Environment Variables#

Check that the required environment variables are set correctly.

# Print all environment variables
$ env

# Print the value of ALTIBASE_HOME (no output means the variable is not set)
$ echo $ALTIBASE_HOME

Setting the Environment Variables#

This section describes how to set ALTIBASE_NLS_USE and LANG, the required environment variables that you must set manually.

First, check the Altibase character set.

iSQL> SELECT NLS_CHARACTERSET FROM V$NLS_PARAMETERS;

The ALTIBASE_NLS_USE and LANG values for each Altibase character set are as follows.

Altibase Character Set ALTIBASE_NLS_USE LANG
MS949 MS949 ko_KR.euckr
KO16KSC5601 KO16KSC5601 ko_KR.euckr
UTF8 UTF8 ko_KR.utf8

So that the environment variables apply every time the OS user logs in, add them to .bash_profile by referring to the table above.

# Add to .bash_profile: when the Altibase character set is UTF8
export ALTIBASE_NLS_USE=UTF8
export LANG=ko_KR.utf8

Apply the added environment variables with the following command.

$ . ~/.bash_profile

Summary#

The following table summarizes the recommended values of the kernel parameters, resource limits, and environment variables described in this document, and how to check them.

Category Item Recommended Setting How to Check
Kernel parameters CPU frequency governor performance cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor | sort -u
CPU core clock speed Fixed at maximum grep MHz /proc/cpuinfo | sort -u
RemoveIPC no grep RemoveIPC /etc/systemd/logind.conf
swappiness 1 cat /proc/sys/vm/swappiness
sysctl vm.swappiness
THP never cat /sys/kernel/mm/transparent_hugepage/enabled
cat /sys/kernel/mm/transparent_hugepage/defrag
All 0 except Hugepagesize grep -i huge /proc/meminfo
Includes 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 kernel.shmmax kernel.shmmni
shmmax 2147483648
Semaphores semmsl 2000 ipcs -s -l
sysctl kernel.sem
semmns 32000
semopm 512
semmni 5029
OS user resource limits data seg size (-d) unlimited ulimit -a
file size (-f) unlimited
open files (-n) 1048576
max memory size (-m) unlimited
virtual memory (-v) unlimited
max user processes (-u) unlimited
Environment variables 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 the Altibase character set
LANG Depends on the Altibase character set

Others#

Red Hat recommends at least 100 GB of swap space for systems with 140 or more logical processors or 3 TB or more of RAM.

For details, see How much swap space is recommended for Red Hat Enterprise Linux? on the Red Hat Customer Portal.

Altibase Process Killed by the systemd Service Timeout#

This applies to Linux distributions that use systemd, such as RHEL 7 or later.

If you register Altibase as a systemd service and set a timeout (TimeoutStartSec or TimeoutSec) in the service unit file, systemd can kill the Altibase process during OS boot before it finishes starting up. In this case, the system log (messages) contains messages like the following.

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.

Altibase takes a long time to start when its memory data and memory indexes are large or when it performs restart recovery during startup. You must therefore set TimeoutStartSec or TimeoutSec generously for your operating environment, or set it to 0 (timeout disabled). Also check TimeoutStopSec, which applies at shutdown. For details, see man systemd.service.

Increased SYS CPU Usage on Servers with Symantec Endpoint Protection#

On RHEL 7 servers with Symantec Endpoint Protection (SEP) for Linux installed, there has been a case where the SEP process increased the SYS CPU usage of the Altibase process. As the number of Altibase sessions grew, the select() and write() system calls increased SYS CPU usage sharply. The issue was resolved by replacing the antivirus program.

References#

Linux Compatibility#

CPU Frequency Governor#

RemoveIPC#

Swappiness#

THP#

max_map_count#

Shared Memory and Semaphores#

Locale#

MALLOC_ARENA_MAX#