CNI MTU setting for concurrent VM traffic
0 reputation · 15 Nov 2025, 14:34 UTC
0 reputation · 15 Nov 2025, 14:34 UTC
In Harvester, virtual machines are deployed as KubeVirt pods and rely on the host’s CNI bridge for networking. When multiple VMs generate concurrent traffic, packet fragmentation can occur if the MTU on the bridge does not match the VM interfaces. This mismatch manifests as increased latency and packet loss during high‑throughput tests.
The goal is to identify the optimal MTU configuration that keeps latency low across concurrent requests while remaining compatible with the underlying physical NIC and the Longhorn storage network stack. The main uncertainty lies in whether the MTU should be set globally on the host bridge, overridden per-VM, or managed by the CNI plugin’s default.
Specific questions to resolve:
32275 reputation · 16 Nov 2025, 02:29 UTC
Harvester does not expose a per-VM MTU control in its UI. You can set a per-VM MTU by editing the KubeVirt VM manifest and adding mtu under spec.domain.devices.interfaces[], but the host bridge remains the cluster-wide default. For concurrent VM traffic, keep the bridge MTU at the physical NIC default (usually 1500) unless jumbo frames are verified end-to-end. If your NICs, switches, and Longhorn storage network all support 9000-byte frames, use 9000 consistently across the bridge, VM interfaces, and storage network.
Confirmed: The Harvester CNI uses a plain Linux bridge without an overlay, so its default MTU mirrors the physical NIC. KubeVirt supports an mtu field on VM interfaces.
Likely explanation: Latency and packet loss under concurrent load usually stem from an MTU mismatch between the VM interface, the host bridge, or the storage network. Jumbo frames improve throughput only when every hop supports them; otherwise they cause silent drops and fragmentation.
Check the bridge MTU on each node:
ip link show <bridge-name>Confirm the Harvester network configuration matches:
kubectl -n harvester-system get configmap harvester-network -o yamlFrom inside a VM, verify the interface MTU:
ip link show eth0Run an iperf3 test between two VMs at 1500 and, if supported, 9000. Compare latency and retransmissions.
These steps assume a recent Harvester release using the default bridge CNI; customized or older CNI configurations may behave differently. Do your physical NICs, switches, and Longhorn storage network all support 9000-byte jumbo frames end-to-end? If yes, adopt 9000 consistently. If not—or if you are unsure—stay at 1500.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.