14 DB2 10 for Linux on System z Using z/VM v6.2, SSI Clusters and LGR
ulimit -d Sets the maximum size of the process’s data segment.
ulimit -f Sets the file size limit in blocks.
If the minimum ulimit values are not met, the DB2 database engine could encounter
unexpected operating system resource shortage errors. These errors can lead to a DB2
database system outage.
3.2.2 Kernel parameters
Set up kernel parameters before you start the DB2 database. The default values may cause
issues such as memory starvation when running a DB2 database system
2
. To avoid such
issues,
semaphores and shared memory values should be updated. If you are able to install
DB2 as root, these parameters may be configured automatically.
Interprocess communication kernel parameters
The Linux interprocess communication (IPC) kernel parameters allow for multiple processes
to communicate with one another.
To improve DB2’s performance and memory usage, adjust several of these kernel
parameters. By doing so, the database manager prevents unnecessary resource errors.
Table 3-2 shows the recommended kernel parameters that should be modified.
Table 3-2 Recommended kernel parameters for modification
2
See the website for up-to-date information, under “Kernel parameter requirements (Linux)”:
http://publib.boulder.ibm.com/infocenter/db2luw/v10r1/
Parameter Description Recommended Value
kernel.shmmax Defines the maximum size of one
shared memory segment in bytes.
90% of total memory, but if you have
a large amount of storage you can
leave 512 MB to 1 GB for the
operating system instead.
kernel.shmall Define the available memory for shared
memory in 4KB pages.
You should convert the shmmax
value to 4 KB.
(shmmax value * 1024 / 4)
kernel.shmmni Define the maximum number of shared
memory segments.
4096. This amount enables large
segments to be created avoiding the
need for thousands of small shared
memory segments. This parameter
may vary depending on your
application.
kernel.sem Four values must be set in this
parameter. The first one is the number of
semaphores, the second indicates the
maximum number of semaphores. The
third is the maximum number of
semaphores operations within one
semop call. And the fourth limits the
number of allocatable semaphores.
250 256000 32 1024
kernel.msgmni Maximum number of queues on the
system
1024
kernel.msgmax Maximum size of a message in bytes 65536
kernel.msgmnb Default size of a queue in bytes 65536
Chapter 3. General memory management 15
Modifying the kernel parameters
You must have root privileges to modify kernel parameters.
To update kernel parameters on Red Hat Enterprise Linux and SUSE Linux
3
, do the
following:
1. Run the ipcs -l command to list the current kernel parameter settings.
2. Analyze the command output to determine whether you must change kernel settings by
comparing the current values with the enforced minimum settings shown in Example 3-2.
This example shows the output of the ipcs command with comments that we added after
the // to indicate the parameter names.
Example 3-2 ipcs -l command output
ipcs -l
------ Shared Memory Limits --------
max number of segments = 4096 // SHMMNI
max seg size (kbytes) = 32768 // SHMMAX
max total shared memory (kbytes) = 8388608 // SHMALL
min seg size (bytes) = 1
------ Semaphore Limits --------
max number of arrays = 1024 // SEMMNI
max semaphores per array = 250 // SEMMSL
max semaphores system wide = 256000 // SEMMNS
max ops per semop call = 32 // SEMOPM
semaphore max value = 32767
------ Messages: Limits --------
max queues system wide = 1024 // MSGMNI
max size of message (bytes) = 65536 // MSGMAX
default max size of queue (bytes) = 65536 // MSGMNB
3. Modify the necessary kernel parameters by editing the /etc/sysctl.conf file. If this file
does not exist, create it. Example 3-3 shows an example of what should be placed into the
file.
Example 3-3 Kernel parameters within /etc/sysctl.conf
#Example for a computer with 16GB of RAM:
kernel.shmmni=4096
kernel.shmmax=17179869184
kernel.shmall=8388608
#kernel.sem=<SEMMSL> <SEMMNS> <SEMOPM> <SEMMNI>
kernel.sem=250 256000 32 4096
kernel.msgmni=16384
kernel.msgmax=65536
3
See the website for up-to-date information, under “Modifying kernel parameters (Linux)”:
http://publib.boulder.ibm.com/infocenter/db2luw/v10r1/
Note: The file /etc/sysctl.conf is provided via a package (RPM). On SUSE Linux
Enterprise Server 11, you would find it in the PROCPS RPM file, and in Red Hat
Enterprise Linux, the INITSCRIPTS RPM file.

Get DB2 10 for Linux on System z Using z/VM v6.2, Single System Image Clusters and Live Guest Relocation now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.