|
@@ -5,13 +5,13 @@ export PATH
|
|
|
#=================================================
|
|
|
# System Required: CentOS 6/7,Debian 8/9,Ubuntu 16+
|
|
|
# Description: BBR+BBR魔改版+BBRplus+Lotserver
|
|
|
-# Version: 1.3.2
|
|
|
+# Version: 1.4.0
|
|
|
# Author: 千影,cx9208
|
|
|
# Blog: https://www.939.me/
|
|
|
-# 本脚本已不更新,推荐使用5.5以上内核自带的bbr速度最佳
|
|
|
+# 推荐使用5.5以上内核直接开启的bbr速度最佳
|
|
|
#=================================================
|
|
|
|
|
|
-sh_ver="1.3.2"
|
|
|
+sh_ver="1.4.0"
|
|
|
github="raw.githubusercontent.com/chiakge/Linux-NetSpeed/master"
|
|
|
|
|
|
Green_font_prefix="\033[32m" && Red_font_prefix="\033[31m" && Green_background_prefix="\033[42;37m" && Red_background_prefix="\033[41;37m" && Font_color_suffix="\033[0m"
|
|
@@ -108,7 +108,7 @@ installlot(){
|
|
|
#启用BBR
|
|
|
startbbr(){
|
|
|
remove_all
|
|
|
- if [[ `echo ${kernel_version} | awk -F'.' '{print $1}'` >= "5" ]]; then
|
|
|
+ if [[ `echo ${kernel_version} | awk -F'.' '{print $1}'` -ge "5" ]]; then
|
|
|
echo "net.core.default_qdisc=cake" >> /etc/sysctl.conf
|
|
|
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
|
|
|
else
|
|
@@ -228,13 +228,10 @@ maxmode=\"1\"">>/appex/etc/config
|
|
|
remove_all(){
|
|
|
rm -rf bbrmod
|
|
|
sed -i '/net.core.default_qdisc/d' /etc/sysctl.conf
|
|
|
- sed -i '/net.ipv4.tcp_congestion_control/d' /etc/sysctl.conf
|
|
|
- sed -i '/fs.file-max/d' /etc/sysctl.conf
|
|
|
- sed -i '/net.core.rmem_max/d' /etc/sysctl.conf
|
|
|
- sed -i '/net.core.wmem_max/d' /etc/sysctl.conf
|
|
|
+ sed -i '/net.ipv4.tcp_congestion_control/d' /etc/sysctl.conf
|
|
|
+ sed -i '/fs.file-max/d' /etc/sysctl.conf
|
|
|
sed -i '/net.core.rmem_default/d' /etc/sysctl.conf
|
|
|
sed -i '/net.core.wmem_default/d' /etc/sysctl.conf
|
|
|
- sed -i '/net.core.netdev_max_backlog/d' /etc/sysctl.conf
|
|
|
sed -i '/net.core.somaxconn/d' /etc/sysctl.conf
|
|
|
sed -i '/net.ipv4.tcp_syncookies/d' /etc/sysctl.conf
|
|
|
sed -i '/net.ipv4.tcp_tw_reuse/d' /etc/sysctl.conf
|
|
@@ -242,7 +239,6 @@ remove_all(){
|
|
|
sed -i '/net.ipv4.tcp_fin_timeout/d' /etc/sysctl.conf
|
|
|
sed -i '/net.ipv4.tcp_keepalive_time/d' /etc/sysctl.conf
|
|
|
sed -i '/net.ipv4.ip_local_port_range/d' /etc/sysctl.conf
|
|
|
- sed -i '/net.ipv4.tcp_max_syn_backlog/d' /etc/sysctl.conf
|
|
|
sed -i '/net.ipv4.tcp_max_tw_buckets/d' /etc/sysctl.conf
|
|
|
sed -i '/net.ipv4.tcp_rmem/d' /etc/sysctl.conf
|
|
|
sed -i '/net.ipv4.tcp_wmem/d' /etc/sysctl.conf
|
|
@@ -251,17 +247,17 @@ remove_all(){
|
|
|
sed -i '/fs.inotify.max_user_instances/d' /etc/sysctl.conf
|
|
|
sed -i '/net.ipv4.tcp_syncookies/d' /etc/sysctl.conf
|
|
|
sed -i '/net.ipv4.tcp_fin_timeout/d' /etc/sysctl.conf
|
|
|
- sed -i '/net.ipv4.tcp_tw_reuse/d' /etc/sysctl.conf
|
|
|
- sed -i '/net.ipv4.tcp_max_syn_backlog/d' /etc/sysctl.conf
|
|
|
- sed -i '/net.ipv4.ip_local_port_range/d' /etc/sysctl.conf
|
|
|
- sed -i '/net.ipv4.tcp_max_tw_buckets/d' /etc/sysctl.conf
|
|
|
sed -i '/net.ipv4.route.gc_timeout/d' /etc/sysctl.conf
|
|
|
sed -i '/net.ipv4.tcp_synack_retries/d' /etc/sysctl.conf
|
|
|
sed -i '/net.ipv4.tcp_syn_retries/d' /etc/sysctl.conf
|
|
|
- sed -i '/net.core.somaxconn/d' /etc/sysctl.conf
|
|
|
- sed -i '/net.core.netdev_max_backlog/d' /etc/sysctl.conf
|
|
|
sed -i '/net.ipv4.tcp_timestamps/d' /etc/sysctl.conf
|
|
|
sed -i '/net.ipv4.tcp_max_orphans/d' /etc/sysctl.conf
|
|
|
+ sed -i '/net.core.rmem_max/d' /etc/sysctl.conf
|
|
|
+ sed -i '/net.core.wmem_max/d' /etc/sysctl.conf
|
|
|
+ sed -i '/net.ipv4.tcp_max_syn_backlog/d' /etc/sysctl.conf
|
|
|
+ sed -i '/net.core.netdev_max_backlog/d' /etc/sysctl.conf
|
|
|
+ sed -i '/net.ipv4.tcp_slow_start_after_idle/d' /etc/sysctl.conf
|
|
|
+ sed -i '/net.ipv4.ip_forward/d' /etc/sysctl.conf
|
|
|
if [[ -e /appex/bin/lotServer.sh ]]; then
|
|
|
bash <(wget --no-check-certificate -qO- https://github.com/MoeClub/lotServer/raw/master/Install.sh) uninstall
|
|
|
fi
|
|
@@ -285,9 +281,7 @@ optimizing_system(){
|
|
|
sed -i '/net.ipv4.tcp_max_tw_buckets/d' /etc/sysctl.conf
|
|
|
sed -i '/net.ipv4.tcp_max_syn_backlog/d' /etc/sysctl.conf
|
|
|
sed -i '/net.core.netdev_max_backlog/d' /etc/sysctl.conf
|
|
|
- sed -i '/net.netfilter.nf_conntrack_max/d' /etc/sysctl.conf
|
|
|
- sed -i '/net.ipv4.netfilter.ip_conntrack_tcp_timeout_established/d' /etc/sysctl.conf
|
|
|
- sed -i '/net.ipv4.tcp_slow_start_after_idle/d' /etc/sysctl.conf
|
|
|
+ sed -i '/net.ipv4.tcp_slow_start_after_idle/d' /etc/sysctl.conf
|
|
|
sed -i '/net.ipv4.ip_forward/d' /etc/sysctl.conf
|
|
|
echo "fs.file-max = 1000000
|
|
|
fs.inotify.max_user_instances = 8192
|
|
@@ -302,8 +296,6 @@ net.core.wmem_default = 2097152
|
|
|
net.ipv4.tcp_max_tw_buckets = 5000
|
|
|
net.ipv4.tcp_max_syn_backlog = 10240
|
|
|
net.core.netdev_max_backlog = 10240
|
|
|
-net.netfilter.nf_conntrack_max = 1000000
|
|
|
-net.ipv4.netfilter.ip_conntrack_tcp_timeout_established = 7200
|
|
|
net.ipv4.tcp_slow_start_after_idle = 0
|
|
|
# forward ipv4
|
|
|
net.ipv4.ip_forward = 1">>/etc/sysctl.conf
|
|
@@ -619,7 +611,7 @@ check_status(){
|
|
|
kernel_status="BBRplus"
|
|
|
elif [[ ${kernel_version} = "3.10.0" || ${kernel_version} = "3.16.0" || ${kernel_version} = "3.2.0" || ${kernel_version} = "4.4.0" || ${kernel_version} = "3.13.0" || ${kernel_version} = "2.6.32" || ${kernel_version} = "4.9.0" ]]; then
|
|
|
kernel_status="Lotserver"
|
|
|
- elif [[ `echo ${kernel_version} | awk -F'.' '{print $1}'` == "4" ]] && [[ `echo ${kernel_version} | awk -F'.' '{print $2}'` -ge 9 ]] || [[ `echo ${kernel_version} | awk -F'.' '{print $1}'` == "5" ]]; then
|
|
|
+ elif [[ `echo ${kernel_version} | awk -F'.' '{print $1}'` == "4" ]] && [[ `echo ${kernel_version} | awk -F'.' '{print $2}'` -ge 9 ]] || [[ `echo ${kernel_version} | awk -F'.' '{print $1}'` -ge "5" ]]; then
|
|
|
kernel_status="BBR"
|
|
|
else
|
|
|
kernel_status="noinstall"
|