I want to show how to configure the kernel parameters to install the Oracle database server on CentOS or RedHat:
Run the ipcs command with the option -l (list):
ipcs -l
As a result, we can get a list of kernel parameters:
------ Shared Memory Limits --------
max number of segments = 4096 // SHMMNI
max seg size (kbytes) = 32768 // SHMMAX
max total shared memory (kbytes) = 3774873 // SHMALL in number of pages
min seg size (bytes) = 1 // SHMMIN
------ 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 = 100 // 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
Check and set kernel parameters, please.
[Kernel parameter] [Value] [Command to check the value]
shmmni 4096 cat /proc/sys/kernel/shmmni
shmall 3774873 cat /proc/sys/kernel/shmall
shmmax 2147483648 cat /proc/sys/kernel/shmmax
shmmin 1 ipcs -lm |grep "min seg size"
semmsl 250 cat /proc/sys/kernel/sem | awk '{print $1}'
semmns 256000 cat /proc/sys/kernel/sem | awk '{print $2}'
semopm 100 cat /proc/sys/kernel/sem | awk '{print $3}'
semmni 1024 cat /proc/sys/kernel/sem | awk '{print $4}'
file-max 65536 cat /proc/sys/fs/file-max
ip_local_port_range 1024 - 65000 cat /proc/sys/net/ipv4/ip_local_port_range
rmem_default 1048576
rmem_max 1048576
wmem_default 262144
wmem_max 1048576
aio-max-nr 1048576
kernel.msgmax 65535
msgmnb 65535
Table 1: Kernel parameters of Linux system (e.g. CentOS or RedHat)
Run commands:
su - root
ipcs -ls
sysctl -p
cat /etc/sysctl.conf
Set the following kernel parameters with a option of sysctl command, or in the vi editor:
sysctl -w kernel.sem="250 256000 100 1024"
sysctl -w fs.file-max=65536
or
vi /etc/sysctl.conf
kernel.sem = 250 256000 100 1024
kernel.shmmax=2147483648 # For a 64-bit system
kernel.shmall=3774873 # For 90 percent of 16 GB memory
kernel.msgmax=65535
kernel.msgmnb=65535
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.file-max = 65536
fs.aio-max-nr = 1048576
Run sysctl command with -p parameter to load sysctl settings from the default file /etc/sysctl.conf:
sysctl -p
ipcs -ls
reboot
su - root
sysctl -p
ipcs -ls
cat /etc/sysctl.conf
Changes will be effective after every reboot, because of executing of /etc/rc.d/rc.sysinit script
called by /etc/inittab will automatically load /etc/sysctl.conf file.
No comments:
Post a Comment