在PVE8中安装RTL8125网卡驱动

起因

近期使用sensors命令查看CPU温度时,发现有一个核心的温度明显高于其他核心,连接数上升后温差更高。

排障

获取网卡地址:

1
lspci | grep Ethernet
1
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. Killer E3000 2.5GbE Controller (rev 06)

查看网卡加载的驱动:

1
lspci -s 03:00.0 -k
1
2
3
4
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. Killer E3000 2.5GbE Controller (rev 06)
Subsystem: ASRock Incorporation Killer E3000 2.5GbE Controller
Kernel driver in use: r8169
Kernel modules: r8169

查看网卡中断数量

1
cat /proc/interrupts | grep -P 'enp3|CPU0' #我的网卡叫enp3s0
1
2
           CPU0	...	CPU3		...	CPU23
181: 0 ... 391472182 ... 0 IR-PCI-MSIX-0000:03:00.0 0-edge enp3s0

分析

这是一块瑞昱的2.5G板载网卡,且加载了r8169驱动,怀疑是RTL8125换皮。

中断大量集中在单个核心上,默认的网卡驱动可能没有开启多队列支持。

准备

获取内核版本

1
uname -a
1
Linux *** 6.5.13-1-pve #1 SMP PREEMPT_DYNAMIC PMX 6.5.13-1 (2024-02-05T13:50Z) x86_64 GNU/Linux

可以看到我的是6.5版本的pve内核

安装依赖

1
2
apt update
apt install dkms proxmox-headers-6.5

安装驱动

快速安装

已经有大佬编译打包好了驱动,启用了TX多队列和RSS,禁用了ASPM。devome/realtek-r8125-dkms

1
2
#自行下载需要的deb包
dpkg -i realtek-r8125-dkms_*_amd64.deb

手动编译

⚠本节内容未经过验证,不保证可用,仅供参考⚠

获取并解压源代码

瑞昱驱动发布页下载对应的驱动源码,并上传至目标主机。

解压源码

1
tar -jxvf <文件名>

假设下载的源码是r8125-9.012.04.tar.bz2

1
tar -jxvf r8125-9.012.04.tar.bz2

参数修改

修改Makefile

1
nano ./r8125-9.012.04/src/Makefile

修改以下内容

1
2
3
CONFIG_ASPM = n
ENABLE_MULTIPLE_TX_QUEUE = y
ENABLE_RSS_SUPPORT = y

移动源码

1
mv ./r8125-9.012.04 /usr/src

构建并安装

1
2
3
dkms add -m r8125 -v 9.012.04
dkms build -m r8125 -v 9.012.04
dkms install -m r8125 -v 9.012.04

配置

禁用自带的r8169驱动

1
echo "blacklist r8169" >> /etc/modprobe.d/dkms.conf

应用修改并重启

1
2
3
update-grub
update-initramfs -u -k all
reboot

效果

1
2
3
4
5
6
lspci -s 03:00.0 -k

03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. Killer E3000 2.5GbE Controller (rev 06)
Subsystem: ASRock Incorporation Killer E3000 2.5GbE Controller
Kernel driver in use: r8125
Kernel modules: r8169, r8125
1
2
3
4
5
6
7
8
9
10
11
12
13
cat /proc/interrupts | grep -P 'enp3|CPU0'

CPU0 ... CPU3 CPU4 CPU5 CPU6 ... CPU19 CPU20 CPU21 CPU22 CPU23
181: 0 ... 1472182 0 0 0 ... 0 0 0 0 0 IR-PCI-MSIX-0000:03:00.0 0-edge enp3s0-0
182: 0 ... 0 1517626 0 0 ... 0 0 0 0 0 IR-PCI-MSIX-0000:03:00.0 1-edge enp3s0-1
183: 0 ... 0 0 1599632 0 ... 0 0 0 0 0 IR-PCI-MSIX-0000:03:00.0 2-edge enp3s0-2
184: 0 ... 0 0 0 1101283 ... 0 0 0 0 0 IR-PCI-MSIX-0000:03:00.0 3-edge enp3s0-3
...
197: 0 ... 0 0 0 0 ... 4680739 0 0 0 0 IR-PCI-MSIX-0000:03:00.0 16-edge enp3s0-16
...
199: 0 ... 0 0 0 0 ... 0 0 1512270 0 0 IR-PCI-MSIX-0000:03:00.0 18-edge enp3s0-18
...
212: 0 ... 0 0 0 0 ... 0 0 0 0 0 IR-PCI-MSIX-0000:03:00.0 31-edge enp3s0-31

可以看到中断确实分散在多个核心上,根据这个帖子,队列配置是1RX/2TX。

[转]VPS脚本合集:测速、WARP、流媒体解锁、性能测试等

点击查看原文

Debian开启BBR

一键开启BBR,优化VPS速度

1
echo -e "\nnet.core.default_qdisc=fq\nnet.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf && sysctl -p

查看是否成功开启

1
sysctl net.ipv4.tcp_congestion_control

若返回如下,则表示启动成功:

1
net.ipv4.tcp_congestion_control = bbr

开启WARP

详细教程 https://lot.pm/cloudflare-warp.html
自动配置 WARP WireGuard 双栈全局网络(所有出站流量走 WARP 网络)

1
bash <(curl -fsSL git.io/warp.sh) d

自动配置 WARP WireGuard IPv4 网络(IPv4 出站流量走 WARP 网络)

1
bash <(curl -fsSL git.io/warp.sh) 4

自动配置 WARP WireGuard IPv6 网络(IPv6 出站流量走 WARP 网络)

1
bash <(curl -fsSL git.io/warp.sh) 6

查看菜单

1
bash <(curl -fsSL git.io/warp.sh) menu

回程测试

TCP回程测试

1
curl https://raw.githubusercontent.com/zhucaidan/mtr_trace/main/mtr_trace.sh|bash

ICMP回程

1
wget -qO- git.io/autobesttrace | bash

流媒体解锁测试
脚本1

1
bash <(curl -L -s https://raw.githubusercontent.com/lmc999/RegionRestrictionCheck/main/check.sh)

脚本2

1
bash <(curl -sL unlock.moe)

性能测试YABS

默认(硬盘、网络、Geekbench6)

1
curl -sL yabs.sh | bash

快速模式(跳过网络测试,仅测硬盘和Geekbench5)

1
curl -sL yabs.sh | bash -s -- -i5

跳过硬盘测试,保留其他

1
curl -sL yabs.sh | bash -s -- -fd

跳过网速测试,保留其他

1
curl -sL yabs.sh | bash -s -- -i

跳过Geekbench,保留其他

1
curl -sL yabs.sh | bash -s -- -g

换为Geekbench 5,保留其他

1
curl -sL yabs.sh | bash -s -- -5

仅测硬盘

1
curl -sL yabs.sh | bash -s -- -ig

仅测速

1
url -sL yabs.sh | bash -s -- -fdg

仅测Geekbench 5

1
curl -sL yabs.sh | bash -s -- -fdi5

仅测Geekbench 5 和 Geekbench 6

1
curl -sL yabs.sh | bash -s -- -fdi56

测速

国内测速

测试VPS到国内电信、移动、联通和教育网的速度以及到亚洲的速度(支持IPv4、Ipv6、单线程、多线程)

1
bash <(curl -Lso- https://bench.im/hyperspeed)

全球测速

默认全球

1
curl -sL network-speed.xyz | bash

区域测速

1
2
region_name = na, sa, eu, asia, africa, middle-east, india, china, iran
curl -sL network-speed.xyz | bash -s -- -r region_name

实例(仅测亚洲)

1
curl -sL network-speed.xyz | bash -s -- -r asia

注:一次测速约耗时10-15分钟,消耗流量几十G至上百G不等。

宝塔面板

7.7原版&开心版

纯原版1:

1
curl -sSO https://raw.githubusercontent.com/zhucaidan/btpanel-v7.7.0/main/install/install_panel.sh && bash install_panel.sh

纯原版2:

1
wget -O install.sh http://f.cccyun.cc/bt/install_6.0.sh && bash install.sh

升级(降级)到7.7命令:

1
curl http://f.cccyun.cc/bt/update6.sh|bash

宝塔7.7原版一键开心脚本

1
curl -sSO https://raw.githubusercontent.com/ztkink/bthappy/main/one_key_happy.sh && bash one_key_happy.sh

新版开心版

Centos安装命令(默认安装是7.8.0 直接在线升级7.9.3):

1
yum install -y wget && wget -O install.sh http://io.bt.sy/install/install_6.0.sh && sh install.sh

试验性Centos/Ubuntu/Debian安装命令 独立运行环境(py3.7) 可能存在少量兼容性问题 不断优化中

1
curl -sSO http://io.bt.sy/install/install_panel.sh && bash install_panel.sh

Ubuntu Deepin安装命令:

1
wget -O install.sh http://io.bt.sy/install/install-ubuntu_6.0.sh && sudo bash install.sh

Debian安装命令:

1
wget -O install.sh http://io.bt.sy/install/install-ubuntu_6.0.sh && bash install.sh

Fedora安装命令:

1
wget -O install.sh http://io.bt.sy/install/install_6.0.sh && bash install.sh

Linux面板 7.9.3 升级企业版命令 1(7.9.3 官方版 / 7.7.0 开心版 可以执行这个升级到 7.9.3 开心版):

1
curl https://io.bt.sy/install/update_panel.sh|bash

讲解:升级企业版命令 1 与 升级企业版命令 2 二选一 都可以升级最新版!

Linux面板 7.9.3 升级企业版命令 2(7.9.3 官方版 / 7.7.0 开心版 可以执行这个升级到 7.9.3 开心版):

1
curl http://io.bt.sy/install/update6.sh|bash

测试

Hello world!

终于,在托更将近三年后,这个站点有内容了。

在此纪念旧的占位页面

1
2
3
4
5
6
<html>
<title>ph59x|Work in progress</title>
<body>
<p>一个仍在开发的站点,预计21/2上线</p>
</body>
</html>

这是哪里?

这里是pH59x的个人博客。主要用来收集一些网络文章,发表自己的帖子,也许还会有别的用途吧。

我的内容基本都是这里首发,如果以后涉及版权问题都以这里的发布时间为准。

目前暂时托管在Github Pages,不排除后期迁移或改变部署方式。