Every time the system boots, the ‘/etc/rc.d/rc.sysinit‘ script is executed by init process. This shell script contains a call to sysctl command and reads the values from /etc/sysctl.conf file as the ones to be set.
Therefore, any values added to /etc/sysctl.conf will take effect after the system boot or without downtime using “ sysctl -p ” command
sysctl.conf is a simple file containing sysctl values to be read in and set by sysctl
The syntax is simply as follows:
# comment
; comment
; comment
token = value
Note that blank lines are ignored, and whitespace before and after a token or value is ignored, although a value can contain whitespace within. Lines which begin with a # or ; are considered remarks / comments and ignored.
Example:
# sysctl.conf sample
#
kernel.sysrq = 1
kernel.sem = 250 32000 100 128 #This sets SEMMSL, SEMMNS, SEMOPM, SEMMNI
kernel.shmmax = 2147483648
kernel.shmall = 2097152
kernel.shmmni = 4096
;
fs.file-max = 65536
;
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.ip_local_port_range = 1024 65000
;
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144
The sysctl command is used to view, set, and automated kernel settings in the /proc/sys/ directory. To get a quick overview of all settings configurable in the /proc/sys/ directory, type the sysctl -a command as root. This will create a large, comprehensive list.
0 comments:
Post a Comment