diff --git a/etc/sysctl.d/80-network-tuning.conf b/etc/sysctl.d/80-network-tuning.conf index 63c0920..a88abbe 100644 --- a/etc/sysctl.d/80-network-tuning.conf +++ b/etc/sysctl.d/80-network-tuning.conf @@ -4,9 +4,17 @@ net.ipv4.tcp_ecn=0 # window scaling net.ipv4.tcp_window_scaling=1 +# Tuning dedicated memory to network cards +net.core.rmem_default = 1048576 +net.core.wmem_default = 1048576 + +# UDP tuning +net.ipv4.udp_rmem_min = 8192 +net.ipv4.udp_wmem_min = 8192 + # increase linux autotuning tcp buffer limits -net.ipv4.tcp_rmem=8192 87380 16777216 -net.ipv4.tcp_wmem=8192 65536 16777216 +net.ipv4.tcp_rmem = 4096 1048576 2097152 +net.ipv4.tcp_wmem = 4096 65536 16777216 # increase TCP max buffer size net.core.rmem_max=16777216 @@ -17,10 +25,10 @@ net.core.netdev_max_backlog=16384 net.core.dev_weight=64 # Increase number of incoming connections -net.core.somaxconn=32768 +# net.core.somaxconn=8096 # Increase the maximum amount of option memory buffers -net.core.optmem_max=65535 +net.core.optmem_max = 65536 # Increase the tcp-time-wait buckets pool size to prevent simple DOS attacks net.ipv4.tcp_max_tw_buckets=1440000 @@ -74,3 +82,8 @@ net.ipv4.tcp_fastopen=3 # This will enusre that immediatly subsequent connections use the new values net.ipv4.route.flush=1 net.ipv6.route.flush=1 + +# Tune TCP keepalive parameters +net.ipv4.tcp_keepalive_time = 60 +net.ipv4.tcp_keepalive_intvl = 10 +net.ipv4.tcp_keepalive_probes = 6 diff --git a/etc/sysctl.d/90-vm-tuning.conf b/etc/sysctl.d/90-vm-tuning.conf index c46f980..ac2e491 100644 --- a/etc/sysctl.d/90-vm-tuning.conf +++ b/etc/sysctl.d/90-vm-tuning.conf @@ -1,4 +1,5 @@ -vm.swappiness=10 -vm.dirty_ratio = 80 -vm.dirty_background_ratio = 5 +vm.swappiness=0 +vm.dirty_ratio = 3 +vm.dirty_background_ratio = 2 +vm.vfs_cache_pressure = 50 vm.dirty_expire_centisecs = 12000