Skip to content

AIX Setup Guide for Altibase#

Overview#

This document describes the kernel parameters and OS user environment that you need to configure to run Altibase reliably on AIX (Advanced Interactive eXecutive). 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 AIX 5.x.

For Altibase property settings, see Altibase Configuration File Guide. For the supported AIX versions, see 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.

Kernel Parameters#

Changing kernel parameters requires root privileges. Use vmo, the virtual memory management utility, to change the file cache parameters, and use smit, the system management utility, to change the other parameters. Even for parameters that take effect immediately, restart the OS after the change to make sure that the new values are applied correctly.

Some parameters, such as Posix AIO, require both a temporary change and a permanent change. A temporary change takes effect immediately, but the parameter can revert to its previous value when the OS restarts. A permanent change keeps the value after the OS restarts.

Posix AIO#

Posix AIO is an AIX feature that improves performance by letting a process handle disk I/O and application computation at the same time. Altibase cannot run when Posix AIO is unavailable, so you must configure it in advance. Starting with AIX 6.1, the default value of Posix AIO is Available, so no separate configuration is needed.

Kernel Parameter Description Recommended Value
Posix AIO (posix_aio0) Whether the asynchronous I/O feature is available. Available

Checking the Posix AIO Setting#

Check the state of the AIO devices with the lsdev command. The state of posix_aio0 must be Available.

$ lsdev -C | grep aio
aio0         Available               Asynchronous I/O (Legacy)
posix_aio0   Available               Posix Asynchronous I/O

Changing Posix AIO Temporarily#

Run smit and navigate to Devices > Asynchronous I/O > Posix Asynchronous I/O. Select Configure Defined Asynchronous I/O to change the state from Defined to Available.

If you change only this setting, Posix AIO can revert to Defined when the OS restarts, so always make the permanent change as well.

Changing Posix AIO Permanently#

Run smit and navigate to Devices > Asynchronous I/O > Posix Asynchronous I/O > Change / Show Characteristics of Asynchronous I/O. Change STATE to be configured at system restart to Available.

File Cache#

The AIX memory manager converts as much unused memory as possible into file cache. In this state, when a new memory allocation request arrives while free memory is low, the memory manager swaps out rarely accessed areas of process memory or the file cache and then allocates the memory. This process of obtaining additional memory is called stealing.

For a process that stays resident in memory for a long time, such as Altibase, the OS can unintentionally swap out data areas that are rarely accessed. When a transaction later accesses a swapped-out area, the disk I/O delay makes the response time of Altibase irregular. Therefore, to keep the response time of Altibase consistent, configure the following kernel parameters in advance so that stealing occurs only in the file cache.

This configuration is not mandatory. AIX 5.2 ML03 and earlier do not have these parameters, and AIX 6.1 and later do not require changes.

Kernel Parameter Description Recommended Value
minperm% Threshold (%) of the file cache share of total memory. 10
lru_file_repage Specifies the target of stealing.
Supported in AIX 5.2 ML5, AIX 5.3 ML2, and later.
0
strict_maxclient Supported in AIX 5.2 ML4 and later. 0

When you set the three parameters to the recommended values, stealing occurs only in the file cache while the file cache occupies minperm% or more of total memory.

If performance or other problems occur, change it in consultation with an AIX engineer.

Checking the File Cache Settings#

Check the current values of minperm%, lru_file_repage, and strict_maxclient with the vmo command.

$ vmo -L

Changing the File Cache Settings#

When you specify the -p option, the vmo command applies the new value immediately and keeps it after the OS restarts.

$ vmo -p -o minperm%=10
$ vmo -p -o lru_file_repage=0
$ vmo -p -o strict_maxclient=0

Maximum Number of Processes per User#

AIX sets some resource limits through kernel parameters instead of ulimit commands in the user configuration file. The maximum number of processes per user is one of them.

Altibase is a single-process, multithreaded application. Therefore, if the system runs no particular application other than Altibase, you do not need to consider this value. Depending on the purpose of the system, however, you need to estimate the number of processes that run at the same time and raise this value accordingly.

Kernel Parameter Description Recommended Value
Maximum number of PROCESSES allowed per user (maxuproc) Maximum number of processes that a user can create. At least the number of processes that run at the same time

Checking the Maximum Number of Processes per User#

Check the maxuproc value with the lsattr command.

$ lsattr -El sys0 -a maxuproc

Changing the Maximum Number of Processes per User#

Run smit and navigate to System Environments > Change / Show Characteristics of Operating System. Change Maximum number of PROCESSES allowed per user to at least the number of processes that run at the same time.

User Environment#

This chapter describes the user environment, resource limits and environment variables, that you need to configure to install and run Altibase on AIX. Here, the user means the OS user who installs Altibase and runs the Altibase process.

The examples in this chapter use sh, bash, and ksh syntax. If you use csh, declare environment variables with the setenv command instead of export.

Resource Limits#

UNIX operating systems place logical limits on the resources that each user can use. Even when physical resources are sufficient, these limits can prevent a process from expanding its memory or data file areas. Because this setting does not affect other processes, set each limit to the maximum value that the OS allows (unlimited if possible).

Note that open files includes not only the files that a process opens but also its communication sockets. Therefore, a small value also limits the number of sessions that can connect to Altibase at the same time.

Resource Item Description Recommended Value
data seg size (data) Maximum size of the process data area unlimited
file size (fsize) Maximum size of a file that can be created unlimited
open files (nofiles) Maximum number of files that one process can open at the same time unlimited
max memory size (rss) Maximum size of usable memory unlimited
virtual memory (memory) Maximum size of usable virtual memory unlimited
max user process Maximum number of processes that a user can create See Maximum Number of Processes per User

Checking the Resource Limits#

Check the resource limits of the user with the following commands.

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

# Print the hard limits.
$ ulimit -Ha

Changing the Resource Limits#

Add ulimit commands to the configuration file of the OS user who installs and runs Altibase.

# Add to the user configuration file: user resource limits
# For Resource Limitation
ulimit -d unlimited  # data segment size, data
ulimit -f unlimited  # file size, fsize
ulimit -n unlimited  # file descriptor(open files), nofiles
ulimit -m unlimited  # max memory size, rss
Hard-Limit and Soft-Limit#

Resource limits are divided into hard limits and soft limits. The hard limit is the maximum value of a resource limit, and only root can change it. The soft limit is the value actually applied to the user, and the user can change it up to the hard limit.

A soft limit changed with the ulimit command takes effect immediately but is valid only in that session. When the same user opens a new session, the previous soft limit applies again, so the ulimit commands are usually added to the user configuration file. However, the system-wide hard limit can prevent this method from setting the intended value. Therefore, rather than relying on the user configuration file, edit /etc/security/limits, the system resource configuration file, to apply resource limits consistently.

Environment Variables#

Altibase is a multithreaded application, so on AIX you need to set environment variables related to multithreading. The following environment variables are the recommended settings to prevent performance degradation on multithreaded SMP systems. Altibase can start without them, but failures of unknown cause can occur, so always set them.

Environment Variable Description Value
AIXTHREAD_MNRATIO Specifies the ratio of k kernel threads that handle n user threads. 1:1
AIXTHREAD_SCOPE Sets the thread model to 1:1. S
AIXTHREAD_MUTEX_DEBUG Removes the overhead of the pthread library managing mutexes, condition variables, and read/write locks for the debugger. OFF
AIXTHREAD_RWLOCK_DEBUG Same as AIXTHREAD_MUTEX_DEBUG. OFF
AIXTHREAD_COND_DEBUG Same as AIXTHREAD_MUTEX_DEBUG. OFF
SPINLOOPTIME Number of attempts to acquire a lock while holding CPU resources. 1000
YIELDLOOPTIME Number of times to yield CPU resources while holding a lock. 50
MALLOCMULTIHEAP Set in multithreaded environments that use malloc heavily. 1
AIXTHREAD_MUTEX_FAST Changes the internal mutex locking behavior of the OS. If mutex contention is severe, setting it to ON can improve performance.
Supported in AIX 5.2 and later.
ON if needed

Checking the Environment Variables#

$ env | grep -E 'AIXTHREAD|SPINLOOPTIME|YIELDLOOPTIME|MALLOCMULTIHEAP'

Setting the Environment Variables#

Add the following lines to the user configuration file so that the environment variables apply each time the OS user logs in.

# Add to the user configuration file: settings for multithreaded applications
# For Multi-Threaded Application
AIXTHREAD_MNRATIO=1:1; export AIXTHREAD_MNRATIO
AIXTHREAD_SCOPE=S; export AIXTHREAD_SCOPE
AIXTHREAD_MUTEX_DEBUG=OFF; export AIXTHREAD_MUTEX_DEBUG
AIXTHREAD_RWLOCK_DEBUG=OFF; export AIXTHREAD_RWLOCK_DEBUG
AIXTHREAD_COND_DEBUG=OFF; export AIXTHREAD_COND_DEBUG
SPINLOOPTIME=1000; export SPINLOOPTIME
YIELDLOOPTIME=50; export YIELDLOOPTIME
MALLOCMULTIHEAP=1; export MALLOCMULTIHEAP

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 Posix AIO Available (required below AIX 6.1) lsdev -C | grep aio
minperm% 10 (consider below AIX 6.1) vmo -L
lru_file_repage 0 (required below AIX 6.1)
strict_maxclient 0 (consider below AIX 6.1)
Maximum number of PROCESSES allowed per user At least the number of processes that run at the same time lsattr -El sys0 -a maxuproc
OS user resource limits data seg size (data) unlimited ulimit -a
file size (fsize) unlimited
open files (nofiles) unlimited
max memory size (rss) unlimited
virtual memory (memory) unlimited
max user process Set with Maximum number of PROCESSES allowed per user
Environment variables AIXTHREAD_MNRATIO 1:1 env
AIXTHREAD_SCOPE S
AIXTHREAD_MUTEX_DEBUG OFF
AIXTHREAD_RWLOCK_DEBUG OFF
AIXTHREAD_COND_DEBUG OFF
SPINLOOPTIME 1000
YIELDLOOPTIME 50
MALLOCMULTIHEAP 1
AIXTHREAD_MUTEX_FAST ON if mutex contention is severe

Others#

Memory Leak Bug in the heapmin Function#

The heapmin function provided by AIX has a bug that can cause a memory leak. For details, see the IBM document IV28577. To avoid this bug, patch or upgrade to an AIX native compiler in which IV28577 is fixed.

Check whether the patch is applied with the following command.

$ instfix -i | grep IV28577
All filesets for IV28577 were found.

If the patch is not applied, the command prints nothing. In that case, ask an AIX engineer to apply the patch or upgrade.

Limit on the Number of IPC Channels#

The AIX semaphore parameter semume limits the number of semaphore undo entries. AIX sets this value to 1024 automatically, and users cannot change it.

Altibase uses three undo entries per IPC channel. Therefore, you can use up to 341 IPC channels (1024 / 3) on AIX.

References#