首批通过分布式安全可靠测评,为关键业务系统打造
网卡速度识别错误导致迁移任务执行慢的问题
更新时间:2026-06-10 01:56
适用版本
OceanBase 数据库 V2.x、V3.x 版本。
问题描述
验证测试中,修改 locality 增加副本,数据迁移复制速度仅有 125MB/s,不及预期。
在对应节点上 iostat -xm 1 观察磁盘写入速度只有 120MB/s。

问题原因
排查过程:
iperf3 网络带宽测速 600MB/s。

通过 fio 检查磁盘 IO,IOPS 测出来大概 500M/s,磁盘 IO 未成为瓶颈。

猜测是 OceanBase 数据库侧磁盘 IO 限速或者网卡带宽限速。在
observer.log日志中发现 WARN 信息如下,看到网卡 speed 获取失败。[2023-08-15 20:17:36.205143] WARN load_file_to_string (utility.h:561) [21800][2][Y0-0000000000000000] [lt=8] [dc=0] read /sys/class/net/eth0/speed failed , errno 22 [2023-08-15 20:17:36.205153] WARN get_ethernet_speed (utility.cpp:631) [21800][2][Y0-0000000000000000] [lt=8] [dc=0] load file /sys/class/net/eth0/speed failed, rc -4000 [2023-08-15 20:17:36.205157] WARN [SERVER] get_network_speed_from_sysfs (ob_server.cpp:1809) [21800][2][Y0-0000000000000000] [lt=3] [dc=0] cannot get Eth ernet speed, use default(tmp_ret=0, devname="eth0") [2023-08-15 20:17:36.205161] WARN [SERVER] runTimerTask (ob_server.cpp:2323) [21800][2][Y0-0000000000000000] [lt=4] [dc=0] ObRefreshNetworkSpeedTask reload bandwidth throttle limit failed(ret=-4000)
最终原因是:数据迁移复制慢的原因是 OBServer 未成功识别网卡 speed,使用了默认值 125MB/s。
解决方法
修改网卡速度。
su - admin
vim /home/admin/oceanbase/etc/nic.rate.config
eth0=10000Mbit

OBServer 会后台定时 load,观察日志。
grep 'succeed to reload_bandwidth_throttle_limit' observer.log
[2023-08-15 20:44:03.339735] INFO easy_connection.c:450 [23503][0][Y0-0000000000000000] [lt=4] [dc=0] Destroying connection not done due to pool->ref(1),
retry(0), conn(0x7f6306864e90).
[2023-08-15 20:44:03.343440] INFO [SERVER] ob_server.cpp:2342 [21800][2][Y0-0000000000000000] [lt=9] [dc=0] network speed changed(from=131072000, to=1310
720000)
[2023-08-15 20:44:03.343450] INFO [COMMON] utility.cpp:1453 [21800][2][Y0-0000000000000000] [lt=10] [dc=0] set bandwidth(old rate=117964800, new rate=117
9648000)
[2023-08-15 20:44:03.343454] INFO [COMMON] utility.cpp:1453 [21800][2][Y0-0000000000000000] [lt=4] [dc=0] set bandwidth(old rate=117964800, new rate=1179
648000)
[2023-08-15 20:44:03.343456] INFO [SERVER] ob_server.cpp:2012 [21800][2][Y0-0000000000000000] [lt=1] [dc=0] succeed to reload_bandwidth_throttle_limit(ol
d_percentage=90, new_percentage=90, network_speed=1310720000, rate=1179648000)
看到 network_speed 从 131072000(125MB/s)更改为 1310720000(约1GB/s)。
修改后数据迁移速度达到了平均 700MB/s,磁盘 util 也达到了 100%。
