下载ToolChain 代码: wget https://cndl.synology.cn/download/ToolChain/toolchain/7.2-63134/AMD%20x86%20Linux%20Linux%205.10.55%20%28epyc7002%29/epyc7002-gcc1220_glibc236_x86_64-GPL.txz tar -Jxf epyc7002-gcc1220_glibc236_x86_64-GPL.txz 下载 Linux-5.10.x 官方内核源代码 代码: wget https://global.synologydownload.com/download/ToolChain/Synology%20NAS%20GPL%20Source/7.2-64570/epyc7002/linux-5.10.x.txz tar -Jxf linux-5.10.x.txz 准备交叉编译 代码: export ARCH=x86_64 export CROSS_COMPILE=/home/parallels/synology/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu- cd linux-5.10.x cp synology/synoconfigs/epyc7002 .config make oldconfig && make prepare && make modules_prepare && make scripts 避免 version magic 错误 修改文件 /linux-5.10.x/include/generated/utsrelease.h 代码: #define UTS_RELEASE "5.10.55+" 编译单个模块 BBR / Fq / Fq_codel / Fq_qie / Cake ⚠️注意:重新编译前要清理目录否则编译出错 代码: make M=net/ipv4/ clean make M=net/ipv4/ CONFIG_TCP_CONG_BBR=m modules -j$(nproc) 代码: make M=net/sched/ clean make M=net/sched/ CONFIG_NET_SCH_FQ=m CONFIG_NET_SCH_FQ_CODEL=m CONFIG_NET_SCH_PIE=m CONFIG_NET_SCH_FQ_PIE=m modules -j$(nproc) 安装内核模块 BBR(复制模块到 /lib/modules/ 目录) 代码: sudo cp /volume1/Exchange/tcp_bbr.ko /lib/modules/ sudo chmod 644 /lib/modules/tcp_bbr.ko sudo insmod /lib/modules/tcp_bbr.ko 安装内核模块 Fq / Fq_Codel / Fq_Pie / Cake (复制模块到 /lib/modules/ 目录) 代码: sudo cp /volume1/Exchange/sch_*.ko /lib/modules/ sudo chmod 644 /lib/modules/sch_*.ko sudo insmod /lib/modules/sch_*.ko 查看可用流控 启用 BBR 和 FQ流控 代码: sysctl net.ipv4.tcp_congestion_control=bbr sysctl net.core.default_qdisc=fq 设置为开机自动启用 BBR 和 FQ 代码: sudo bash -c 'echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf' sudo bash -c 'echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf' 设置为开机自动加载内核 代码: sudo bash -c 'echo tcp_bbr > /usr/lib/modules-load.d/90-tcp_bbr.conf' sudo bash -c 'echo sch_fq > /usr/lib/modules-load.d/91-sch_fq.conf' sudo bash -c 'echo sch_fq_codel >> /usr/lib/modules-load.d/91-sch_fq.conf' sudo bash -c 'echo sch_pie > /usr/lib/modules-load.d/91-sch_pie.conf' sudo bash -c 'echo sch_fq_pie >> /usr/lib/modules-load.d/91-sch_pie.conf' sudo bash -c 'echo sch_cake > /usr/lib/modules-load.d/91-sch_cake.conf' sudo chmod 644 /usr/lib/modules-load.d/9* ⚠️注意:群晖修改/usr/lib/modules-load.d 需要更新 modules.dep 文件,否则会导致自动关机,修复方法如下 代码: sudo ln -s /bin/kmod /usr/sbin/depmod sudo /sbin/depmod -a 2>/dev/null sudo systemctl restart systemd-modules-load 额外的TCP连接优化 代码: sudo bash -c 'echo "net.ipv4.tcp_fastopen=3" >> /etc/sysctl.conf' 编译好的 TCP_BBR 以及 Fq / Fq_Codel / Fq_Pie / Cake 隐藏内容: ******隐藏内容-请回复后再查看****** ******You must reply before you can see the hidden data contained here.******
感谢。。。 root@NAS:~# sysctl net.core.default_qdisc=fq sysctl: setting key "net.core.default_qdisc": No such file or directory net.core.default_qdisc = fq