CentOS 9 KVM虚拟机透传10Gbps网卡仅跑1Gbps性能异常求助
CentOS 9 KVM虚拟机透传10Gbps网卡仅跑1Gbps性能异常求助
各位好,我最近被一个问题卡了快一周,实在找不到解决办法,来求助大家:
我有一台运行CentOS Stream 9的KVM宿主机,它自带一块传统的1Gbps网卡用于日常通用网络,另外还配备了一块Intel NC522SFP的10Gbps网卡,专门用来和我的电脑做高速数据传输。
首先说下宿主机上的测试情况:当我直接给这块10G网卡配置好IP后,用iperf3做测试,得到的结果如下:
Connecting to host 192.168.11.203, port 5201 [ 4] local 192.168.11.100 port 1229 connected to 192.168.11.203 port 5201 [ ID] Interval Transfer Bandwidth [ 4] 0.00-1.00 sec 645 MBytes 5.41 Gbits/sec [ 4] 1.00-2.00 sec 684 MBytes 5.74 Gbits/sec [ 4] 2.00-3.00 sec 678 MBytes 5.69 Gbits/sec [ 4] 3.00-4.00 sec 671 MBytes 5.63 Gbits/sec [ 4] 4.00-5.00 sec 672 MBytes 5.64 Gbits/sec [ 4] 5.00-6.00 sec 674 MBytes 5.65 Gbits/sec [ 4] 6.00-7.00 sec 659 MBytes 5.53 Gbits/sec [ 4] 7.00-8.00 sec 678 MBytes 5.69 Gbits/sec [ 4] 8.00-9.00 sec 664 MBytes 5.57 Gbits/sec [ 4] 9.00-10.00 sec 663 MBytes 5.56 Gbits/sec - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bandwidth [ 4] 0.00-10.00 sec 6.53 GBytes 5.61 Gbits/sec sender [ 4] 0.00-10.00 sec 6.53 GBytes 5.61 Gbits/sec receiver
这个速度虽然没跑满10Gbps,但我猜测是PCIE端口的带宽限制导致的,而且我的P410阵列卡本身也输出不了更高的速度,所以这个结果我是能接受的。
但问题来了:当我在这台宿主机上创建了一台同样是CentOS Stream 9的虚拟机,把这块10G网卡通过**直通模式(virtio)**分配给虚拟机后,用iperf3测试居然只能跑到1Gbps的速度,测试结果如下:
Connecting to host 192.168.11.240, port 5201 [ 4] local 192.168.11.100 port 1138 connected to 192.168.11.240 port 5201 [ ID] Interval Transfer Bandwidth [ 4] 0.00-1.00 sec 128 MBytes 1.08 Gbits/sec [ 4] 1.00-2.00 sec 128 MBytes 1.08 Gbits/sec [ 4] 2.00-3.00 sec 129 MBytes 1.08 Gbits/sec [ 4] 3.00-4.00 sec 128 MBytes 1.08 Gbits/sec [ 4] 4.00-5.00 sec 130 MBytes 1.09 Gbits/sec [ 4] 5.00-6.00 sec 126 MBytes 1.05 Gbits/sec [ 4] 6.00-7.00 sec 125 MBytes 1.05 Gbits/sec [ 4] 7.00-8.00 sec 128 MBytes 1.07 Gbits/sec [ 4] 8.00-9.00 sec 126 MBytes 1.05 Gbits/sec [ 4] 9.00-10.00 sec 124 MBytes 1.04 Gbits/sec - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bandwidth [ 4] 0.00-10.00 sec 1.24 GBytes 1.07 Gbits/sec sender [ 4] 0.00-10.00 sec 1.24 GBytes 1.07 Gbits/sec receiver
有没有大佬能帮我分析下,为什么虚拟机里的性能比宿主机差这么多?万分感谢!
备注:内容来源于stack exchange,提问作者Karnalta
相关产品推荐
相关产品推荐

