Linux安装bbr并进行调优(调整优化)
编辑/etc/security/limits.conf,添加
soft nofile 51200
hard nofile 51200
编辑/etc/profile,添加ulimit -SHn 51200
接着修改配置文件/etc/sysctl.d/local.conf或者/etc/sysctl.conf,添加# max open files
fs.file-max = 1024000
# max read buffer
net.core.rmem_max = 67108864
# max write buffer
net.core.wmem_max = 67108864
# default read buffer
net.core.rmem_default = 65536
# default write buffer
net.core.wmem_default = 65536
# max processor input queue
net.core.netdev_max_backlog = 4096
# max backlog
net.core.somaxconn = 4096
# resist SYN flood attacks
net.ipv4.tcp_syncookies = 1
# reuse timewait sockets when safe
net.ipv4.tcp_tw_reuse = 1
# turn off fast timewait sockets recycling
net.ipv4.tcp_tw_recycle = 0
# short FIN timeout
net.ipv4.tcp_fin_timeout = 30
# short keepalive time
net.ipv4.tcp_keepalive_time = 1200
# outbound port range
net.ipv4.ip_local_port_range = 10000 65000
# max SYN backlog
net.ipv4.tcp_max_syn_backlog = 4096
# max timewait sockets held by system simultaneously
net.ipv4.tcp_max_tw_buckets = 5000
# TCP receive buffer
net.ipv4.tcp_rmem = 4096 87380 67108864
# TCP write buffer
net.ipv4.tcp_wmem = 4096 65536 67108864
# turn on path MTU discovery
net.ipv4.tcp_mtu_probing = 1
# for high-latency network
net.ipv4.tcp_congestion_control = hybla
# for no NAT network
net.ipv4.tcp_fastopen = 3
# other
vm.min_free_kbytes = 5120
vm.overcommit_memory = 1
vm.panic_on_oom = 1
vm.swappiness = 80
vm.vfs_cache_pressure = 200
保存配置sysctl -p
检查是否开启了hyblasysctl net.ipv4.tcp_available_congestion_control
如果没有hybla,开启hyblamodprobe tcp_hybla
安装bbr,Debian 7以上执行
wget https://github.com/tcp-nanqinlang/general/releases/download/3.4.2.1/tcp_nanqinlang-fool-1.3.0.sh
bash tcp_nanqinlang-fool-1.3.0.sh
CentOS 6以上执行wget https://raw.githubusercontent.com/tcp-nanqinlang/general/master/General/CentOS/bash/tcp_nanqinlang-1.3.2.sh
bash tcp_nanqinlang-1.3.2.sh
,根据提示执行1,在执行2,接着重启即可
评论