QoS (Quality of Service) is a technology that can set different bandwidth and priorities for different application traffic, ensuring that key services can still provide good performance when network resources are limited.
For example, when using one VDS for multiple system networks mode for deployment, multiple system networks or VM networks share one VDS and the bandwidth of the physical network ports associated with the VDS. If no QoS policy is configured, traffic of all networks is forwarded without differentiation. If one type of application traffic is too high, it may exhaust all bandwidth of all physical network ports, preventing other services from being provided properly. In this case, configuring a QoS policy can ensure the service quality of key services.
QoS can reserve bandwidth for virtual networks on a VDS, set traffic priority and weight, and limit bandwidth. "Reserved bandwidth" refers to the guaranteed bandwidth configured for a virtual network. The sum of reserved bandwidth of all networks in one VDS cannot exceed the upper limit of physical network ports. "Bandwidth limit" refers to the upper limit that a virtual network can reach, and can limit the maximum bandwidth and max burst size of the virtual network. QoS policies for VM networks and system networks take effect only on egress traffic that passes through physical network ports.
Configuring QoS for virtual networks can optimize service performance. For example, the management network has low traffic bandwidth requirements, so you can configure lower bandwidth for it. The storage network requires high bandwidth and low latency, so you can configure higher bandwidth and a higher shared bandwidth priority for it. For example, a VDS is associated with two physical network ports with a bandwidth of 10 Gbps and uses the balance-slb bonding mode, so the maximum bandwidth of the VDS reaches 20 Gbps. By configuring QoS, you can reserve 10 Gbps bandwidth for the storage network, 1 Gbps for the management network, and 5 Gbps for the VM network. Different services can share the remaining 4 Gbps bandwidth based on priority.
When creating a VDS, bonding multiple physical network ports can increase the total egress bandwidth. However, different port bonding modes impose some restrictions on bandwidth policy configuration in QoS. The following uses two bonded physical network ports as an example. In different bonding modes, the total available bandwidth of the VDS is different:
active-backup
One physical network port is in the Active state, and the other physical network port is in the Backup state. The total bandwidth is determined by the bandwidth of the Active port.
balance-slb
Both physical network ports are Active. However, because balance-slb distributes traffic based on the source MAC address and VLAN, traffic of the virtual NIC of the same virtual machine can be forwarded only through one physical network port because the MAC address is fixed. Therefore, although the total bandwidth is the sum of the bandwidth of the two physical network ports, the virtual machine can use the bandwidth of only one physical network port at a given time.
For example, two 10 Gbps physical network ports provide a total bandwidth of 20 Gbps. 1 Gbps bandwidth is configured for the management network, 12 Gbps for the storage network, and 4 Gbps for the VM network. Because the MAC addresses of the management network, storage network, and VM network are fixed at a given time, traffic can use only one physical network port at a given time. The allocated total bandwidth of each virtual network is provided by the two physical network ports together. For example, the 4 Gbps bandwidth of the VM network is provided by the two physical network ports, 2 Gbps each.
balance-tcp
Both physical network ports are Active. However, balance-tcp distributes traffic based on the five-tuple information of a network connection. Therefore, a specific connection can use only one physical network port. The bandwidth allocation method of balance-tcp is the same as that of balance-slb. In this bonding mode, multiple different connections can fully utilize physical bandwidth.
ACOS uses the TC (Traffic Control) functional component provided by the kernel to implement QoS settings for virtual NIC egress and ingress traffic by creating a queue at the port. The settings include maximum bandwidth and max burst size.
To ensure network stability and balance burst traffic, you are advised to set max burst size to 20% of the maximum bandwidth. For example, if you want to set the egress traffic maximum bandwidth of a virtual machine port to 1000 Mbit/s, you can set max burst size to 200 Mbit.
Note that rate limiting involves multiple factors, and the actual rate limit may have a certain deviation from the configured value, usually about 5% of the configured value.