知乎專欄 | 多維度架構 | 微信號 netkiller-ebook | QQ群:128659835 請註明“讀者” |
內存與交換分區分配相關
https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Performance_Tuning_Guide/s-memory-captun.html
vm.overcommit_memory = 1
https://github.com/google/bbr
2017 年之後已經整合近 linux 內核
查看當前算法
neo@netkiller ~ % sudo sysctl -a | egrep "net.ipv4.tcp_congestion_control|net.core.default_qdisc" net.core.default_qdisc = fq_codel net.ipv4.tcp_congestion_control = cubic neo@netkiller ~ % cat /proc/sys/net/ipv4/tcp_congestion_control cubic
確認內核已經含有 tcp_bbr 模組
root@netkiller ~ % lsmod | grep tcp_bbr tcp_bbr 20480 1
切換到bbr算法
: sudo -s sysctl -w "net.core.default_qdisc=fq" sysctl -w "net.ipv4.tcp_congestion_control=bbr"
切回cubic
sysctl -w "net.core.default_qdisc=fq_codel" sysctl -w "net.ipv4.tcp_congestion_control=cubic"
寫入 /etc/sysctl.conf 檔案
echo "net.core.default_qdisc=fq" | sudo tee -a /etc/sysctl.conf echo "net.ipv4.tcp_congestion_control=bbr" | sudo tee -a /etc/sysctl.conf sudo sysctl -p