Skip to content

Solaris Setup Guide for Altibase#

Overview#

This document describes the kernel parameters and OS user environment settings required to run Altibase reliably on Solaris. 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 6 or later and SunOS 5.8 to 5.10.

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

To run Altibase on Solaris, you must set the shared memory and semaphore kernel parameters.

How you change kernel parameters depends on the SunOS version. On SunOS 5.10 and earlier, you set kernel parameters in the /etc/system file. SunOS 5.10 introduced projects, which let you apply resource control values to each user account. Both methods require root privileges, and you must restart the system to apply the changes correctly.

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, and Altibase uses them to communicate with clients on the same server. Depending on its configuration, Altibase can also load the memory database into shared memory.

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 Solaris and the values that Altibase recommends are as follows.

Kernel Parameter Description Recommended Value
shmmax The maximum size of one shared memory segment, in bytes. 2147483649 (2 GB + 1)
shmmni The maximum number of shared memory segments in the system. 500 or more
shmseg The maximum number of shared memory segments that one process can attach. 200 or more
Loading the Memory Database into Shared Memory#

By default, Altibase loads the memory database into the heap area of its process. If you configure Altibase to load the memory database into shared memory, you must also consider shmmax and shmmni.

At startup, Altibase creates one segment whose size equals the Altibase property STARTUP_SHM_CHUNK_SIZE, so set shmmax larger than STARTUP_SHM_CHUNK_SIZE. As memory database usage grows, Altibase automatically expands its memory area by creating new segments of EXPAND_CHUNK_PAGE_COUNT * 32 KB, so set shmmni as generously as possible.

Semaphores#

A semaphore is a resource that the OS provides to restrict access to shared resources in IPC. When Altibase uses shared memory as the communication buffer, it 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 Solaris and the values that Altibase recommends are as follows.

Kernel Parameter Description Recommended Value
semmns The maximum number of semaphores in the whole system. 8192
semmni The maximum number of semaphore sets. You can set it up to 65535. 5029
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
semmap The semaphore space obtained by the semget call. 5024
semmnu The maximum number of undo structures in the system. 1024
semopm The maximum number of operations that one semop system call processes. 512
semume The maximum number of undo entries per process. 512
semvmx The maximum value of one semaphore. Do not set it higher than 32767. 32767

Checking the Shared Memory and Semaphore Settings#

Checking /etc/system Settings (SunOS 5.10 and Earlier)#

Check the current shared memory and semaphore settings with the sysdef command.

$ sysdef | grep -i -E 'shm|sem'
Checking Project Settings (SunOS 5.10 and Later)#

Check the values assigned to the project with the projects command, and check the resource controls actually applied to the project with the prctl command.

# Check the values assigned to projects
$ projects -l

# Check the resource controls applied to the project user.altibase
$ prctl -i project user.altibase

Changing Shared Memory and Semaphores#

Editing /etc/system (SunOS 5.10 and Earlier)#

Open the /etc/system file in an editor.

$ vi /etc/system

Add the following lines.

set shmsys:shminfo_shmmin = 1
set shmsys:shminfo_shmmax = 2147483649
set shmsys:shminfo_shmmni = 500
set shmsys:shminfo_shmseg = 200
set semsys:seminfo_semmns = 8192
set semsys:seminfo_semmni = 5029
set semsys:seminfo_semmsl = 2000
set semsys:seminfo_semmap = 5024
set semsys:seminfo_semmnu = 1024
set semsys:seminfo_semopm = 512
set semsys:seminfo_semume = 512
Setting Project Resource Controls (SunOS 5.10 and Later)#

SunOS 5.10 removed some of the existing IPC kernel parameters. Instead, assign the shared memory and semaphore settings to the project of the OS user that runs Altibase with the projadd and projmod commands. The following example is for an OS user named altibase. Set project.max-shm-memory to the physical memory size of the system.

# Create the project user.altibase and set the maximum number of semaphore sets
$ projadd -U altibase -K "project.max-sem-ids=(priv,5029,deny)" user.altibase

# Shared memory: replace <physical memory size> with the physical memory size of the system.
$ projmod -a -K "project.max-shm-memory=(priv,<physical memory size>,deny)" user.altibase
$ projmod -a -K "project.max-shm-ids=(priv,1024,deny)" user.altibase

# Semaphores
$ projmod -a -K "process.max-sem-nsems=(priv,2000,deny)" user.altibase
$ projmod -a -K "process.max-sem-ops=(priv,512,deny)" user.altibase

# Message queues
$ projmod -a -K "project.max-msg-messages=(priv,100,deny)" user.altibase
$ projmod -a -K "project.max-msg-ids=(priv,100,deny)" user.altibase
$ projmod -a -K "process.max-msg-qbytes=(priv,1048576,deny)" user.altibase

User Environment#

This chapter describes the user environment settings required to install and operate Altibase on Solaris: 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. 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#

Solaris sets logical limits on the resources that each user account can use. Even when physical resources are sufficient, these limits can cause memory allocation or data file expansion to fail. Because this setting does not affect other processes, we recommend setting it to the maximum value that the OS allows (unlimited if possible).

In particular, open files counts not only the files that a process opens but also its communication sockets. If this value is small, it also limits the number of sessions that can connect to Altibase at the same time.

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

Resource (ulimit Output Item) ulimit Option Description Recommended Value
data seg size -d Maximum size of the process data segment unlimited
file size -f Maximum size of a file that can be created unlimited
open files -n Maximum number of files that one process can open at the same time unlimited
max memory size - Maximum size of memory that can be used unlimited
virtual memory -v Maximum size of virtual memory that can be used unlimited
max user processes - Maximum number of processes that a user can create unlimited

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

Changing the Resource Limits#

Add ulimit commands to the environment configuration file (such as .profile) of the OS user who installs and runs Altibase.

# Add to the user environment configuration file: user resource limits
# For Resource Limitation
ulimit -d unlimited  # data segment size
ulimit -f unlimited  # file size
ulimit -n unlimited  # file descriptor(open files)
ulimit -v unlimited  # virtual memory
When You Need a Value Larger Than the Hard Limit#

The hard limit is the maximum 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. Therefore, ulimit commands in the user environment configuration file cannot set a value larger than the hard limit.

In this case, apply the resource limits by editing a system-level configuration file. Solaris has no separate system configuration file for user resource limits, so set them in /etc/system. You can also use /etc/default/login or /etc/profile.

Environment Variables#

The environment variables to set after installing Altibase are as follows. LD_LIBRARY_PATH_64 exists only on Solaris.

Environment Variable Description Value
ALTIBASE_HOME Specifies the Altibase installation path. Depends on the environment
PATH Specifies the location of Altibase utilities and shell scripts. $ALTIBASE_HOME/bin
LD_LIBRARY_PATH Specifies the location of the Altibase shared libraries. $ALTIBASE_HOME/lib
LD_LIBRARY_PATH_64 Specifies the location of 64-bit shared libraries. $ALTIBASE_HOME/lib
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

If the database character set is not US7ASCII, you must set ALTIBASE_NLS_USE. Otherwise, the client connects with the default US7ASCII, and the data you entered appears garbled when you query it.

Checking the Environment Variables#

Check that the 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#

First, check the Altibase character set.

iSQL> SELECT NLS_CHARACTERSET FROM V$NLS_PARAMETERS;

So that the environment variables apply every time the OS user logs in, add them to the user environment configuration file. Set ALTIBASE_NLS_USE to the Altibase character set that you checked above.

# Add to the user environment configuration file: when the Altibase character set is MS949
# For ALTIBASE
ALTIBASE_HOME=/ALTIBASE;  export ALTIBASE_HOME;
PATH=$ALTIBASE_HOME/bin:$PATH;  export PATH;
ALTIBASE_NLS_USE=MS949;  export ALTIBASE_NLS_USE;
LD_LIBRARY_PATH=$ALTIBASE_HOME/lib:$LD_LIBRARY_PATH;  export LD_LIBRARY_PATH;
LD_LIBRARY_PATH_64=$ALTIBASE_HOME/lib:$LD_LIBRARY_PATH_64;  export LD_LIBRARY_PATH_64;

Apply the added environment variables with the following command.

$ . ~/.profile

To display characters correctly, also set the encoding of your terminal to match the database character set.

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
Shared memory shmmax 2147483649 (2 GB + 1) sysdef | grep -i -E 'shm|sem' (SunOS 5.10 and earlier)
projects -l
prctl -i project user.altibase (SunOS 5.10 and later)
shmmni 500 or more
shmseg 200 or more
Semaphores semmns 8192
semmni 5029
semmsl 2000
semmap 5024
semmnu 1024
semopm 512
semume 512
semvmx 32767
OS user resource limits data seg size (-d) unlimited ulimit -a
file size (-f) unlimited
open files (-n) unlimited
max memory size unlimited
virtual memory (-v) unlimited
max user processes unlimited
Environment variables ALTIBASE_HOME Altibase installation path (absolute path) env
PATH $ALTIBASE_HOME/bin
LD_LIBRARY_PATH $ALTIBASE_HOME/lib
LD_LIBRARY_PATH_64 $ALTIBASE_HOME/lib
ALTIBASE_NLS_USE Same as the Altibase character set