Skip to content

Commit

Permalink
feat: 自动开启 BBR
Browse files Browse the repository at this point in the history
  • Loading branch information
devhaozi committed Jan 12, 2024
1 parent c0db1cf commit c7ad1a1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts/install_panel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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' \
Expand Down

0 comments on commit c7ad1a1

Please sign in to comment.