From c7ad1a1435a981a957614fc0c3bce64b902bee71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Fri, 12 Jan 2024 22:45:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=87=AA=E5=8A=A8=E5=BC=80=E5=90=AF=20?= =?UTF-8?q?BBR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/install_panel.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/install_panel.sh b/scripts/install_panel.sh index 991e89af..7007cf4f 100644 --- a/scripts/install_panel.sh +++ b/scripts/install_panel.sh @@ -110,6 +110,15 @@ Prepare_System() { echo fs.file-max = 6553560 >> /etc/sysctl.conf fi + # 自动开启 BBR + isBBRSupported=$(sysctl net.ipv4.tcp_available_congestion_control | grep -c bbr) + if [ "${isBBRSupported}" != "0" ]; then + qdisc=$(sysctl net.core.default_qdisc | awk '{print $3}') + echo "net.core.default_qdisc=${qdisc}" >> /etc/sysctl.conf + echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf + sysctl -p + fi + if [ "${OS}" == "centos" ]; then if ${inChina}; then sed -e 's|^mirrorlist=|#mirrorlist=|g' \