shmmax, shmall, swaping/paging related parameters


In general, if a current parameter settings in /etc/sysctl.conf is higher than the value in the below table, you just leave it alone.  However, the parameters like SHMMAX should be adjust to ½ or more physical memory on the server and the SHMALL is based on physical memory size / page size.

Controls IP packet forwarding
net.ipv4.ip_forward = 0

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0

# Controls whether core dumps will append the PID to the core filename
# Useful for debugging multi-threaded applications
kernel.core_uses_pid = 1

# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1

# Controls the maximum size of a message, in bytes
kernel.msgmnb = 65536

# Controls the default maxmimum size of a mesage queue
kernel.msgmax = 65536

# Controls the maximum shared segment size, in bytes
kernel.shmmax = 48719476736 (For example:  the DB server has 90GB)

# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 23592960 (For example:  sum of all the SGAs on the system=90GBs, devided by the pagesize 4Kb)

SQL> select 90*1024*1024*1024/4096 from dual;

90*1024*1024*1024/4096
----------------------
              23592960

To tune swaping / paging of the server, you need to work with Sys Admin to adjust these parameters appropriately

#Reduce swapping:
vm.swappiness = 10
#Maximum percentage of active memory that can have dirty pages:
vm.dirty_background_ratio=3
#Maximum percentage of total memory that can have dirty pages:
vm.dirty_ratio=15
#How long data can be in page cache before being expired:
vm.dirty_expire_centisecs=500
#How often pdflush is activated to clean dirty pages:
vm.dirty_writeback_centisecs=100

No comments:

Post a Comment