Table of Contents

linux#kernle

Kernel Parameter in Linux



Check Kernel Parameters

# sysctl -a
sunrpc.tcp_slot_table_entries = 16
sunrpc.udp_slot_table_entries = 16
sunrpc.max_resvport = 1023
sunrpc.min_resvport = 665
sunrpc.nlm_debug = 0
sunrpc.nfsd_debug = 0
sunrpc.nfs_debug = 0
sunrpc.rpc_debug = 0
mc.check_pci_parity = 0
mc.panic_on_pci_parity = 0
mc.poll_msec = 1000
mc.log_ce = 1


How to change Kernel Parameter

temporary

echo 65536 > /proc/sys/fs/file-max
sysctl -w fs.file-max=65536

Permanence

/etc/sysctl.conf

#vi /etc/sysctl.conf
kernel.msgmni=512
vm.swappiness=0

# sysctl -p        <- reflect


Parameter Lists

Keepalive

Parameter Value Note
net.ipv4.tcp_keepalive_intvl 75 ← default
2
net.ipv4.tcp_keepalive_time 7200 ← default
30
net.ipv4.tcp_keepalive_probes 9 ← default
Default : 
    7200(sec) +  75(sec)×9(times) 
    = 7200(sec) + 675(sec) = 7,875(sec) = 131.25(min) = 2.1875(hours)

After :
    30(sec) +  2(sec)×9(times) 
    = 30(sec) + 18(sec) = 48(sec)


File Handles

Parameter Value Note
fs.file-max 65536


Check

To determine the maximum number of file handles for the entire system

cat /proc/sys/fs/file-max



To determine the current usage of file handles

cat /proc/sys/fs/file-nr

The file-nr file displays three parameters: