User Tools

Site Tools


kernel_tuning

Kernel Tuning

This tuning i have used for dedicated DB server.
You can use it, as it is on any modern server, but please make sure to read note once.

###### Optimization Dec. 22 2011 ######

## Reduce Swapping

vm.swappiness = 30
vm.dirty_ratio = 50
vm.dirty_background_ratio = 5

## Prevent Syn Attack

net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_syn_retries = 5
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_max_syn_backlog = 4096

## Enable IP Spoofing Protection

net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.rp_filter = 1

## Decrease tcp fin timeout

net.ipv4.tcp_fin_timeout = 15

## Decrease the time default value for keep alive

net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_keepalive_probes = 5
net.ipv4.tcp_keepalive_intvl = 15

## Enable Fix for RFC1337

net.ipv4.tcp_rfc1337 = 1

<note warning> ## Not for Low memory system </note>

## Increase Read Buffer

net.ipv4.tcp_rmem = 8192 87380 16777216
net.ipv4.udp_rmem_min = 16384
net.core.rmem_default = 131072
net.core.rmem_max = 16777216

## Increase Write Buffer

net.ipv4.tcp_wmem = 8192 65536 16777216
net.ipv4.udp_wmem_min = 16384
net.core.wmem_default = 131072
net.core.wmem_max = 16777216

## Increase Number of incocimng connections

net.core.somaxconn = 32768

## Increase max buffer for con.

net.core.optmem_max = 65536

## Increase TCP queue lenght

net.ipv4.neigh.default.proxy_qlen = 96
net.ipv4.neigh.default.unres_qlen = 6

## increase slots for tcp / udp

sunrpc.tcp_slot_table_entries = 32
sunrpc.udp_slot_table_entries = 32

## increase uRPC datagram queue lenght

net.unix.max_dgram_qlen = 50
kernel_tuning.txt · Last modified: 2011/12/22 09:40 by k2patel