setting kernel params in redhat

To determine the maximum size of a shared memory segment, run:
# cat /proc/sys/kernel/shmmax
2147483648
The default shared memory limit for SHMMAX can be changed in the proc file system without reboot:
# echo 2147483648 > /proc/sys/kernel/shmmax
Alternatively, you can use sysctl(8) to change it:
# sysctl -w kernel.shmmax=2147483648
To make a change permanent, add the following line to the file /etc/sysctl.conf (your setting may vary).
This file is used during the boot process.
# echo “kernel.shmmax=2147483648” >> /etc/sysctl.conf
We also got this:
Checking kernel
222/433
parameters
Checking for
semmsl=250; found semmsl=250. Passed
Checking for
semmns=32000; found semmns=32000. Passed
Checking for
semopm=100; found semopm=32. Failed
<<<<
Checking for
semmni=128; found semmni=128. Passed
Checking for
shmmax=536870912; found shmmax=33554432. Failed
<<<<
Checking for
shmmni=4096; found shmmni=4096. Passed
Checking for
shmall=2097152; found shmall=2097152. Passed
Checking for
file-max=65536; found file-max=751357. Passed
Checking for
VERSION=2.6.9; found VERSION=2.6.9-55.0.0.0.2.ELlargesmp.
Passed
Checking for
ip_local_port_range=1024 – 65000; found ip_local_port_range=32768
– 61000. Failed
<<<<
Checking for
rmem_default=262144; found rmem_default=135168. Failed
<<<<
Checking for
rmem_max=262144; found rmem_max=135168. Failed
<<<<
Checking for
wmem_default=262144; found wmem_default=135168. Failed
<<<<
Checking for
wmem_max=262144; found wmem_max=135168. Failed
<<<<
Check complete. The
overall result of this check is: Failed
<<<<
Problem: The kernel
parameters do not meet the minimum requirements (see
above).
Recommendation: Perform
operating system specific instructions to update the kernel
parameters.
223/433
so for semopm we do a:
[root@irwdbd1 ~]# ipcs -ls
—— Semaphore Limits ——–
max number of arrays = 128
max semaphores per array = 250
max semaphores system wide = 32000
max ops per semop call = 32
semaphore max value = 32767
and set it to be changed on reboot as:
[root@server ~]# echo “kernel.sem=250 32000 100 128” >> /etc/sysctl.conf
set it also live as:
[root@server ~]# echo “250 32000 100 128” > /proc/sys/kernel/sem
For the rest, i just added these lines to /etc/sysctl.conf:
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=262144
net.core.wmem_default=262144
net.core.rmem_max=262144
net.core.wmem_max=262144
and ran a
[root@server ~]# /sbin/sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
kernel.sem = 250 32000 100 128
224/433
kernel.shmmax = 536870912
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_max = 262144
You can also run these commands to get the variables oracle recommends to tune:
sysctl -a | grep -i shmmni
sysctl -a | grep -i ‘kernel.sem’
sysctl -a | grep -i ip_local_port_range
sysctl -a | grep -i rmem_default
sysctl -a | grep -i rmem_max
sysctl -a | grep -i wmem_default
sysctl -a | grep -i wmem_max
sysctl -a | grep -i shmmax
You will get something like:
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
kernel.shmmax = 2147483648
225/433

Leave a Reply

Your email address will not be published. Required fields are marked *