{"id":438,"date":"2011-01-28T00:30:38","date_gmt":"2011-11-14T21:51:50","guid":{"rendered":"http:\/\/kraftek.com\/blog\/setting-kernel-params-in-redhat\/"},"modified":"2011-01-28T00:30:38","modified_gmt":"2011-11-14T21:51:50","slug":"setting-kernel-params-in-redhat","status":"publish","type":"post","link":"\/blog\/index.php\/setting-kernel-params-in-redhat\/","title":{"rendered":"setting kernel params in redhat"},"content":{"rendered":"<p>To determine the maximum size of a shared memory segment, run:<br \/>\n# cat \/proc\/sys\/kernel\/shmmax<br \/>\n2147483648<br \/>\nThe default shared memory limit for SHMMAX can be changed in the proc file system without reboot:<br \/>\n# echo 2147483648 &gt; \/proc\/sys\/kernel\/shmmax<br \/>\nAlternatively, you can use sysctl(8) to change it:<br \/>\n# sysctl -w kernel.shmmax=2147483648<br \/>\nTo make a change permanent, add the following line to the file \/etc\/sysctl.conf (your setting may vary).<br \/>\nThis file is used during the boot process.<br \/>\n# echo &#8220;kernel.shmmax=2147483648&#8221; &gt;&gt; \/etc\/sysctl.conf<br \/>\nWe also got this:<br \/>\nChecking kernel<br \/>\n222\/433<br \/>\nparameters<br \/>\nChecking for<br \/>\nsemmsl=250; found semmsl=250. Passed<br \/>\nChecking for<br \/>\nsemmns=32000; found semmns=32000. Passed<br \/>\nChecking for<br \/>\nsemopm=100; found semopm=32. Failed<br \/>\n&lt;&lt;&lt;&lt;<br \/>\nChecking for<br \/>\nsemmni=128; found semmni=128. Passed<br \/>\nChecking for<br \/>\nshmmax=536870912; found shmmax=33554432. Failed<br \/>\n&lt;&lt;&lt;&lt;<br \/>\nChecking for<br \/>\nshmmni=4096; found shmmni=4096. Passed<br \/>\nChecking for<br \/>\nshmall=2097152; found shmall=2097152. Passed<br \/>\nChecking for<br \/>\nfile-max=65536; found file-max=751357. Passed<br \/>\nChecking for<br \/>\nVERSION=2.6.9; found VERSION=2.6.9-55.0.0.0.2.ELlargesmp.<br \/>\nPassed<br \/>\nChecking for<br \/>\nip_local_port_range=1024 &#8211; 65000; found ip_local_port_range=32768<br \/>\n&#8211; 61000. Failed<br \/>\n&lt;&lt;&lt;&lt;<br \/>\nChecking for<br \/>\nrmem_default=262144; found rmem_default=135168. Failed<br \/>\n&lt;&lt;&lt;&lt;<br \/>\nChecking for<br \/>\nrmem_max=262144; found rmem_max=135168. Failed<br \/>\n&lt;&lt;&lt;&lt;<br \/>\nChecking for<br \/>\nwmem_default=262144; found wmem_default=135168. Failed<br \/>\n&lt;&lt;&lt;&lt;<br \/>\nChecking for<br \/>\nwmem_max=262144; found wmem_max=135168. Failed<br \/>\n&lt;&lt;&lt;&lt;<br \/>\nCheck complete. The<br \/>\noverall result of this check is: Failed<br \/>\n&lt;&lt;&lt;&lt;<br \/>\nProblem: The kernel<br \/>\nparameters do not meet the minimum requirements (see<br \/>\nabove).<br \/>\nRecommendation: Perform<br \/>\noperating system specific instructions to update the kernel<br \/>\nparameters.<br \/>\n223\/433<br \/>\nso for semopm we do a:<br \/>\n[root@irwdbd1 ~]# ipcs -ls<br \/>\n&#8212;&#8212; Semaphore Limits &#8212;&#8212;&#8211;<br \/>\nmax number of arrays = 128<br \/>\nmax semaphores per array = 250<br \/>\nmax semaphores system wide = 32000<br \/>\nmax ops per semop call = 32<br \/>\nsemaphore max value = 32767<br \/>\nand set it to be changed on reboot as:<br \/>\n[root@server ~]# echo &#8220;kernel.sem=250 32000 100 128&#8221; &gt;&gt; \/etc\/sysctl.conf<br \/>\nset it also live as:<br \/>\n[root@server ~]# echo &#8220;250 32000 100 128&#8221; &gt; \/proc\/sys\/kernel\/sem<br \/>\nFor the rest, i just added these lines to \/etc\/sysctl.conf:<br \/>\nnet.ipv4.ip_local_port_range = 1024 65000<br \/>\nnet.core.rmem_default=262144<br \/>\nnet.core.wmem_default=262144<br \/>\nnet.core.rmem_max=262144<br \/>\nnet.core.wmem_max=262144<br \/>\nand ran a<br \/>\n[root@server ~]# \/sbin\/sysctl -p<br \/>\nnet.ipv4.ip_forward = 0<br \/>\nnet.ipv4.conf.default.rp_filter = 1<br \/>\nnet.ipv4.conf.default.accept_source_route = 0<br \/>\nkernel.sysrq = 0<br \/>\nkernel.core_uses_pid = 1<br \/>\nkernel.sem = 250 32000 100 128<br \/>\n224\/433<br \/>\nkernel.shmmax = 536870912<br \/>\nnet.ipv4.ip_local_port_range = 1024 65000<br \/>\nnet.core.rmem_default = 262144<br \/>\nnet.core.wmem_default = 262144<br \/>\nnet.core.rmem_max = 262144<br \/>\nnet.core.wmem_max = 262144<br \/>\nYou can also run these commands to get the variables oracle recommends to tune:<br \/>\nsysctl -a | grep -i shmmni<br \/>\nsysctl -a | grep -i &#8216;kernel.sem&#8217;<br \/>\nsysctl -a | grep -i ip_local_port_range<br \/>\nsysctl -a | grep -i rmem_default<br \/>\nsysctl -a | grep -i rmem_max<br \/>\nsysctl -a | grep -i wmem_default<br \/>\nsysctl -a | grep -i wmem_max<br \/>\nsysctl -a | grep -i shmmax<br \/>\nYou will get something like:<br \/>\nkernel.shmmni = 4096<br \/>\nkernel.sem = 250 32000 100 128<br \/>\nnet.ipv4.ip_local_port_range = 1024 65000<br \/>\nnet.core.rmem_default = 262144<br \/>\nnet.core.rmem_max = 262144<br \/>\nnet.core.wmem_default = 262144<br \/>\nnet.core.wmem_max = 262144<br \/>\nkernel.shmmax = 2147483648<br \/>\n225\/433<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &gt; \/proc\/sys\/kernel\/shmmax Alternatively, you can use sysctl(8) to change it: # sysctl -w kernel.shmmax=2147483648 To make a change permanent, add [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-438","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts\/438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=438"}],"version-history":[{"count":0,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts\/438\/revisions"}],"wp:attachment":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=438"},{"taxonomy":"post_tag","embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}