User Tools

Site Tools


kernel_tuning

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
kernel_tuning [2011/12/22 14:36]
k2patel
kernel_tuning [2020/08/10 02:35] (current)
Line 8: Line 8:
    
 === ## Reduce Swapping === === ## Reduce Swapping ===
 +<code bash>
 vm.swappiness = 30 vm.swappiness = 30
 vm.dirty_ratio = 50 vm.dirty_ratio = 50
 vm.dirty_background_ratio = 5 vm.dirty_background_ratio = 5
 +</​code>​
 === ## Prevent Syn Attack === === ## Prevent Syn Attack ===
 +<code bash>
 net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_syncookies = 1
 net.ipv4.tcp_syn_retries = 5 net.ipv4.tcp_syn_retries = 5
 net.ipv4.tcp_synack_retries = 2 net.ipv4.tcp_synack_retries = 2
 net.ipv4.tcp_max_syn_backlog = 4096 net.ipv4.tcp_max_syn_backlog = 4096
 +</​code>​
 === ## Enable IP Spoofing Protection === === ## Enable IP Spoofing Protection ===
 +<code bash>
 net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.all.rp_filter = 1
 net.ipv4.conf.default.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1
 +</​code>​
 === ## Decrease tcp fin timeout === === ## Decrease tcp fin timeout ===
 +<code bash>
 net.ipv4.tcp_fin_timeout = 15 net.ipv4.tcp_fin_timeout = 15
 +</​code>​
 === ## Decrease the time default value for keep alive === === ## Decrease the time default value for keep alive ===
 +<code bash>
 net.ipv4.tcp_keepalive_time = 300 net.ipv4.tcp_keepalive_time = 300
 net.ipv4.tcp_keepalive_probes = 5 net.ipv4.tcp_keepalive_probes = 5
 net.ipv4.tcp_keepalive_intvl = 15 net.ipv4.tcp_keepalive_intvl = 15
 +</​code>​
 === ## Enable Fix for RFC1337 === === ## Enable Fix for RFC1337 ===
- + <code bash>
 net.ipv4.tcp_rfc1337 = 1 net.ipv4.tcp_rfc1337 = 1
 +</​code>​
  
 <note warning> <note warning>
Line 45: Line 45:
  
 === ## Increase Read Buffer === === ## Increase Read Buffer ===
- +<code bash> 
-net.ipv4.tcp_rmem = "8192 87380 16777216"+net.ipv4.tcp_rmem = 8192 87380 16777216
 net.ipv4.udp_rmem_min = 16384 net.ipv4.udp_rmem_min = 16384
 net.core.rmem_default = 131072 net.core.rmem_default = 131072
 net.core.rmem_max = 16777216 net.core.rmem_max = 16777216
 +</​code>​
 === ## Increase Write Buffer === === ## Increase Write Buffer ===
- +<code bash> 
-net.ipv4.tcp_wmem = "8192 65536 16777216"+net.ipv4.tcp_wmem = 8192 65536 16777216
 net.ipv4.udp_wmem_min = 16384 net.ipv4.udp_wmem_min = 16384
 net.core.wmem_default = 131072 net.core.wmem_default = 131072
 net.core.wmem_max = 16777216 net.core.wmem_max = 16777216
 +</​code>​
 === ## Increase Number of incocimng connections === === ## Increase Number of incocimng connections ===
 +<code bash>
 net.core.somaxconn = 32768 net.core.somaxconn = 32768
 +</​code>​
 === ## Increase max buffer for con. === === ## Increase max buffer for con. ===
 +<code bash>
 net.core.optmem_max = 65536 net.core.optmem_max = 65536
 +</​code>​
 === ## Increase TCP queue lenght === === ## Increase TCP queue lenght ===
 +<code bash>
 net.ipv4.neigh.default.proxy_qlen = 96 net.ipv4.neigh.default.proxy_qlen = 96
 net.ipv4.neigh.default.unres_qlen = 6 net.ipv4.neigh.default.unres_qlen = 6
 +</​code>​
 === ## increase slots for tcp / udp === === ## increase slots for tcp / udp ===
 +<code bash>
 sunrpc.tcp_slot_table_entries = 32 sunrpc.tcp_slot_table_entries = 32
 sunrpc.udp_slot_table_entries = 32 sunrpc.udp_slot_table_entries = 32
 +</​code>​
 === ## increase uRPC datagram queue lenght === === ## increase uRPC datagram queue lenght ===
 +<code bash>
 net.unix.max_dgram_qlen = 50 net.unix.max_dgram_qlen = 50
 +</​code>​
kernel_tuning.1324564611.txt.gz · Last modified: 2020/08/10 02:30 (external edit)