mirror of
https://github.com/hwdsl2/openvpn-install.git
synced 2026-01-11 19:06:18 +00:00
Improve sysctl settings
- For enabling TCP BBR congestion control, add a check to make sure tcp_congestion_control exists.
This commit is contained in:
@@ -424,7 +424,8 @@ update_sysctl() {
|
|||||||
|| { /bin/rm -f "$conf_opt"; touch "$conf_opt"; }
|
|| { /bin/rm -f "$conf_opt"; touch "$conf_opt"; }
|
||||||
# Enable TCP BBR congestion control if kernel version >= 4.20
|
# Enable TCP BBR congestion control if kernel version >= 4.20
|
||||||
if modprobe -q tcp_bbr \
|
if modprobe -q tcp_bbr \
|
||||||
&& printf '%s\n%s' "4.20" "$(uname -r)" | sort -C -V; then
|
&& printf '%s\n%s' "4.20" "$(uname -r)" | sort -C -V \
|
||||||
|
&& [ -f /proc/sys/net/ipv4/tcp_congestion_control ]; then
|
||||||
cat >> "$conf_opt" <<'EOF'
|
cat >> "$conf_opt" <<'EOF'
|
||||||
net.core.default_qdisc = fq
|
net.core.default_qdisc = fq
|
||||||
net.ipv4.tcp_congestion_control = bbr
|
net.ipv4.tcp_congestion_control = bbr
|
||||||
|
|||||||
Reference in New Issue
Block a user