From 6e10ccdb85844f808bd0113e084e93c51ae6deaa Mon Sep 17 00:00:00 2001 From: goldsquid Date: Thu, 13 Nov 2025 11:01:56 +0700 Subject: [PATCH] make better default network settings --- clone-node.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/clone-node.sh b/clone-node.sh index 554ea8d0..33ccae3a 100755 --- a/clone-node.sh +++ b/clone-node.sh @@ -364,6 +364,30 @@ main() { echo " Successful: $success_count/$volume_count" [[ -n "$failed_volumes" ]] && echo " Failed:$failed_volumes" + # Restore Network buffer and congestion control settings. + # These are better for your 0.2-1.4ms environment + + ssh "$DEST_HOST" " + # These are better for your 0.2-1.4ms environment + sudo sysctl -w net.core.rmem_max=2097152 # 2MB + sudo sysctl -w net.core.wmem_max=2097152 + sudo sysctl -w net.ipv4.tcp_rmem='4096 87380 2097152' + sudo sysctl -w net.ipv4.tcp_wmem='4096 87380 2097152' + sudo sysctl -w net.ipv4.tcp_congestion_control=cubic + sudo sysctl -w net.core.default_qdisc=fq_codel + sudo sysctl -w net.ipv4.tcp_slow_start_after_idle=0 + sudo sysctl -w net.ipv4.tcp_tw_reuse=1 + " + + sudo sysctl -w net.core.rmem_max=2097152 # 2MB + sudo sysctl -w net.core.wmem_max=2097152 + sudo sysctl -w net.ipv4.tcp_rmem='4096 87380 2097152' + sudo sysctl -w net.ipv4.tcp_wmem='4096 87380 2097152' + sudo sysctl -w net.ipv4.tcp_congestion_control=cubic + sudo sysctl -w net.core.default_qdisc=fq_codel + sudo sysctl -w net.ipv4.tcp_slow_start_after_idle=0 + sudo sysctl -w net.ipv4.tcp_tw_reuse=1 + $SSH_CMD -O exit "$DEST_HOST" 2>/dev/null # Exit with appropriate status (cleanup will be handled by trap)