Kernel parameter requirements ( Linux DB2)
https://www.ibm.com/support/knowledgecenter/SSEPGG_9.7.0/com.ibm.db2.luw.qb.server.doc/doc/c0057140.html
You must have root authority to modify kernel parameters.
- Run the ipcs -l command to list the current kernel parameter settings.
# ipcs -l ------ Shared Memory Limits --------
max number of segments = // SHMMNI
max seg size (kbytes) = // SHMMAX
max total shared memory (kbytes) = // SHMALL
min seg size (bytes) = ------ Semaphore Limits --------
max number of arrays = // SEMMNI
max semaphores per array = // SEMMSL
max semaphores system wide = // SEMMNS
max ops per semop call = // SEMOPM
semaphore max value = ------ Messages: Limits --------
max queues system wide = // MSGMNI
max size of message (bytes) = // MSGMAX
default max size of queue (bytes) = // MSGMNB
- Modify the kernel parameters that you have to adjust by editing the /etc/sysctl.conf file. If this file does not exist, create it. The following lines are examples of what should be placed into the file:
#Example for a computer with 16GB of RAM:
kernel.shmmni=
kernel.shmmax=
kernel.shmall=
#kernel.sem=<SEMMSL> <SEMMNS> <SEMOPM> <SEMMNI>
kernel.sem=
kernel.msgmni=
kernel.msgmax=
kernel.msgmnb=
- Run sysctl with -p parameter to load in sysctl settings from the default file /etc/sysctl.conf:
sysctl -p
- Optional: Have the changes persist after every reboot:
- (SUSE Linux) Make boot.sysctl active.
- (Red Hat) The rc.sysinit initialization script reads the /etc/sysctl.conf file automatically.
这里对每个参数值做个简要的解释和说明。 ()shmmax:参数定义了共享内存段的最大值(以字节为单位)。缺省为32M,对于db2oracle来说,该缺省值太低了,设置为RAM内存大小单位byte 即17179869184///=16G, ()shmmni:参数用于设置系统范围内共享内存段的最大值。该参数的默认值是 4096btyes 。通常不需要更改。 ()shmall:该参数表示系统一次可以使用的共享内存总量(以页为单位)。缺省值就是2097152,通常不需要修改,设置为RAM的90%。 ()sem:该参数表示设置的信号量。这4个参数内容大小固定。 ()file-max:该参数表示文件句柄的最大数量。文件句柄设置表示在linux系统中可以打开的文件数量。
参考配置:
vi /etc/sysctl.conf #kernel.sem=<SEMMSL> <SEMMNS> <SEMMNS> <SEMOPM> <SEMMNI> kernel.sem=250 256000 32 1024 kernel.shmmax=1073741824 #以64位系统为例的shmmax设置值 kernel.shmall=3774873 #以16GB内存为例的90%的shmal设置值 kernel.msgmni=1024kernel.msgmax=65535 kernel.msgmnb=65535