Posts Tagged ‘substitite’

Optimizing Linux TCP/IP Networking

Tuesday, April 8th, 2008

Some time ago I thought of ways to optimize my Linux Servers network performanceand I googled around I found few interesting websites which give me the idea of some of the basic sysctl variables used for optimizing the GNU/Linux Network stack. Here are the variables themselves and some good example:


values.net.ipv4.ip_forward = 0 ( Turn off IP Forwarding )
net.ipv4.conf.default.rp_filter = 1
( Control Source route verification )
net.ipv4.conf.default.accept_redirects = 0
( Disable ICMP redirects )
net.ipv4.conf.all.accept_redirects = 0 ( same as above )
net.ipv4.conf.default.accept_source_route = 0
( Disable IP source routing )
net.ipv4.conf.all.accept_source_route = 0
( - || - )net.ipv4.tcp_fin_timeout = 40
( Decrease FIN timeout ) - Useful on busy/high load
serversnet.ipv4.tcp_keepalive_time = 4000 ( keepalive tcp timeout )
net.core.rmem_default = 786426 - Receive memory stack size ( a good idea to increase it if your server receives big files )
net.ipv4.tcp_rmem = "4096 87380 4194304"
net.core.wmem_default = 8388608 ( Reserved Memory per connection )
net.core.wmem_max = 8388608
net.core.optmem_max = 40960
( maximum amount of option memory buffers )
# like a homework investigate by yourself what the variables below stand for :)
net.ipv4.tcp_max_tw_buckets = 360000
net.ipv4.tcp_reordering = 5
net.core.hot_list_length = 256
net.core.netdev_max_backlog = 1024

Also a good sysctl.conf file which one might want to substitite or use as a skele for some productive server is ready for download here

The above sysctl.conf is natively created to run on Debian and on other distributions like CentOS, Fedora Slackware some values might either require slight modifications.
Hope this helps and gives you some idea of how network optimization in Linux is usually done. Happy tweakening !

Share this on