Info
Content

Default sysctl tweaks


The following sysctl tweaks can be used on any Linux distribution.

Start by opening the sysctl.conf file with your favorite editor. In this example we will be using nano.

nano /etc/sysctl.conf

Copy the following variables into the file.

net.core.netdev_max_backlog = 800000 
net.core.somaxconn = 262144 
net.core.optmem_max = 524287 
net.core.rmem_max = 25165824 
net.core.wmem_max = 25165824 
net.core.rmem_default = 16777216 
net.core.wmem_default = 16777216 

net.ipv4.netfilter.ip_conntrack_max = 2048000 
net.ipv4.ip_local_port_range = 1024 65535 

net.ipv4.tcp_tw_recycle = 1 
net.ipv4.tcp_tw_reuse = 1 
net.ipv4.tcp_max_syn_backlog = 8192 
net.ipv4.tcp_max_orphans = 65563 
net.ipv4.tcp_fin_timeout = 30 

net.ipv4.tcp_rmem = 4096 25165824 25165824 
net.ipv4.tcp_wmem = 4096 25165824 25165824 
net.ipv4.tcp_mem = 4096 25165824 25165824 
net.ipv4.tcp_low_latency = 0 
net.ipv4.tcp_moderate_rcvbuf = 1 
net.ipv4.route.flush = 1 
net.ipv4.tcp_timestamps = 1 

net.ipv4.tcp_window_scaling = 1 
net.ipv4.tcp_sack = 1 
net.ipv4.tcp_fack = 1

Save the file and reload the sysctl settings with the following command

sysctl -p /etc/sysctl.conf

All the variables you defined in the file will now be loaded at boot time.

No Comments
Back to top