From 6a525c6c104bf98dd56fe4b3ad8ab5902c4dfe9c Mon Sep 17 00:00:00 2001 From: hwdsl2 Date: Wed, 7 Sep 2022 23:29:10 -0500 Subject: [PATCH] Optimize TCP buffers - Improve VPN performance by tuning TCP buffer sizes. --- vpnsetup_alpine.sh | 8 ++++---- vpnsetup_amzn.sh | 8 ++++---- vpnsetup_centos.sh | 8 ++++---- vpnsetup_ubuntu.sh | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/vpnsetup_alpine.sh b/vpnsetup_alpine.sh index 908e8eb..59c13d3 100755 --- a/vpnsetup_alpine.sh +++ b/vpnsetup_alpine.sh @@ -433,10 +433,10 @@ net.ipv4.conf.default.rp_filter = 0 net.ipv4.conf.$NET_IFACE.send_redirects = 0 net.ipv4.conf.$NET_IFACE.rp_filter = 0 -net.core.wmem_max = 12582912 -net.core.rmem_max = 12582912 -net.ipv4.tcp_rmem = 10240 87380 12582912 -net.ipv4.tcp_wmem = 10240 87380 12582912 +net.core.wmem_max = 16777216 +net.core.rmem_max = 16777216 +net.ipv4.tcp_rmem = 4096 87380 16777216 +net.ipv4.tcp_wmem = 4096 87380 16777216 EOF fi } diff --git a/vpnsetup_amzn.sh b/vpnsetup_amzn.sh index cb9fb1b..19d6a57 100755 --- a/vpnsetup_amzn.sh +++ b/vpnsetup_amzn.sh @@ -444,10 +444,10 @@ net.ipv4.conf.default.rp_filter = 0 net.ipv4.conf.$NET_IFACE.send_redirects = 0 net.ipv4.conf.$NET_IFACE.rp_filter = 0 -net.core.wmem_max = 12582912 -net.core.rmem_max = 12582912 -net.ipv4.tcp_rmem = 10240 87380 12582912 -net.ipv4.tcp_wmem = 10240 87380 12582912 +net.core.wmem_max = 16777216 +net.core.rmem_max = 16777216 +net.ipv4.tcp_rmem = 4096 87380 16777216 +net.ipv4.tcp_wmem = 4096 87380 16777216 EOF fi } diff --git a/vpnsetup_centos.sh b/vpnsetup_centos.sh index 97188dd..7b355c9 100755 --- a/vpnsetup_centos.sh +++ b/vpnsetup_centos.sh @@ -544,10 +544,10 @@ net.ipv4.conf.default.rp_filter = 0 net.ipv4.conf.$NET_IFACE.send_redirects = 0 net.ipv4.conf.$NET_IFACE.rp_filter = 0 -net.core.wmem_max = 12582912 -net.core.rmem_max = 12582912 -net.ipv4.tcp_rmem = 10240 87380 12582912 -net.ipv4.tcp_wmem = 10240 87380 12582912 +net.core.wmem_max = 16777216 +net.core.rmem_max = 16777216 +net.ipv4.tcp_rmem = 4096 87380 16777216 +net.ipv4.tcp_wmem = 4096 87380 16777216 EOF if modprobe -q tcp_bbr; then cat >> /etc/sysctl.conf <<'EOF' diff --git a/vpnsetup_ubuntu.sh b/vpnsetup_ubuntu.sh index dcc592b..fa55400 100755 --- a/vpnsetup_ubuntu.sh +++ b/vpnsetup_ubuntu.sh @@ -494,10 +494,10 @@ net.ipv4.conf.default.rp_filter = 0 net.ipv4.conf.$NET_IFACE.send_redirects = 0 net.ipv4.conf.$NET_IFACE.rp_filter = 0 -net.core.wmem_max = 12582912 -net.core.rmem_max = 12582912 -net.ipv4.tcp_rmem = 10240 87380 12582912 -net.ipv4.tcp_wmem = 10240 87380 12582912 +net.core.wmem_max = 16777216 +net.core.rmem_max = 16777216 +net.ipv4.tcp_rmem = 4096 87380 16777216 +net.ipv4.tcp_wmem = 4096 87380 16777216 EOF if modprobe -q tcp_bbr; then cat >> /etc/sysctl.conf <<'EOF'