Makes recommendations for kernel parameter values based on the size of a system. The recommended values are high enough for a given system that they can accommodate most reasonable workloads. This command is currently available only for DB2® databases on the Solaris operating system and for 64-bit DB2 instances on HP-UX.
db2osconf -h
Usage:
-c # Client only
-f # Compare to current
-h # Help screen
-l # List current
-m <mem in GB> # Specify memory in GB
-n <num CPUs> # Specify number of CPUs
-p <perf level> # Msg Q performance level (0-3)
-s <scale factor> # Scale factor (1-3)
-t <threads> # Number of threads
****** Please Change the Following in the Given Order ******
WARNING [<parameter name>] should be set to <value>
These parameters are set in the /etc/system file. The following is a guide to set the values, and is what the db2osconf utility uses to recommend them. For each local connection DB2 will use one semaphore and one shared memory segment to communicate. If the multithreaded application is a local application and has X number of connections to DB2 databases, then that application (process) will need X number of shared memory segments and X number of the semaphore undo structures to communicate with the DB2 database system. So the value of the two kernel parameters should be set to X + 10 (the plus 10 provides a safety margin).
Without the -l or -f switches, the db2osconf utility displays the kernel parameters using the syntax of the /etc/system file. To prevent human errors, the output can be cut and pasted directly into the /etc/system file.
The kernel parameters are recommended based on both the number of CPUs and the amount of physical memory on the system. If one is disproportionately low, the recommendations will be based on the lower of the two.
db2osconf -t 500
set msgsys:msginfo_msgmax = 65535
set msgsys:msginfo_msgmnb = 65535
set msgsys:msginfo_msgssz = 32
set msgsys:msginfo_msgseg = 32767
set msgsys:msginfo_msgmap = 2562
set msgsys:msginfo_msgmni = 2560
set msgsys:msginfo_msgtql = 2560
set semsys:seminfo_semmap = 3074
set semsys:seminfo_semmni = 3072
set semsys:seminfo_semmns = 6452
set semsys:seminfo_semmnu = 3072
set semsys:seminfo_semume = 600
set shmsys:shminfo_shmmax = 2134020096
set shmsys:shminfo_shmmni = 3072
set shmsys:shminfo_shmseg = 600
Total kernel space for IPC:
0.35MB (shm) + 1.77MB (sem) + 1.34MB (msg) == 3.46MB (total)
The
recommended values for set semsys:seminfo_semume and set
shmsys:shminfo_shmseg were the additional values provided
by running db2osconf -t 500.Even though it is possible to recommend kernel parameters based on a particular DB2 database workload, this level of accuracy is not beneficial. If the kernel parameter values are too close to what are actually needed and the workload changes in the future, the DB2 database manager might encounter a problem due to a lack of interprocess communication (IPC) resources. A lack of IPC resources can lead to an unplanned outage for the DB2 database manager and a reboot would be necessary in order to increase kernel parameters. By setting the kernel parameters reasonably high, it should reduce or eliminate the need to change them in the future. The amount of memory consumed by the kernel parameter recommendations is almost trivial compared to the size of the system. For example, for a system with 4 GB of RAM and 4 CPUs, the amount of memory for the recommended kernel parameters is 4.67 MB or 0.11%. This small fraction of memory used for the kernel parameters should be acceptable given the benefits.
crw-r----- 1 root sys 13, 1 Jul 19 18:06 /dev/kmem
crw-rw-rw- 1 root sys 72, 0 Feb 19 1999 /dev/ksyms
crw-r----- 1 root sys 13, 0 Feb 19 1999 /dev/mem