I.4 Ring Buffer and txqueuelen Configuration (KVM)
To enable ring buffer configuration, use the KVM flavor and glance image. This increases the network throughout the VM.
- Ensure that the ring buffer sizes and
txqueuelen
are set to max on all the ethernet devices on the host machine.- Before setting ring buffer value for VMs, verify the pre-set
maximum value on the hostmachine of RX and TX for all the interfaces using
the following
command:
ethtool -g <interface-name>
For example:
/sbin/ethtool -g eth0 /sbin/ethtool -g eth1 /sbin/ethtool -g eth2 /sbin/ethtool -g eth3 Sample output of above command: ethtool -g eth0 Ring parameters for eth0: Pre-set maximum: RX: 4096 RX Mini: n/a RX Jumbo: n/a TX: 4096 Current hardware settings: RX: 2080 RX Mini: n/a RX Jumbo: n/a TX: 2080
- Create
30_ring_buff
file by performing the following commands:[root@DSR-X9KVM-1 dispatcher.d]# cd /etc/NetworkManager/dispatcher.d/
[root@DSR-X9KVM-1 dispatcher.d]# vim 30_ring_buff #!/bin/bash /sbin/ethtool -G ens1f0 rx 4078 tx 4078 /sbin/ethtool -G ens1f1 rx 4078 tx 4078 /sbin/ethtool -G ens1f2 rx 4078 tx 4078 /sbin/ethtool -G ens1f3 rx 4078 tx 4078 ifconfig ens1f0 txqueuelen 120000 ifconfig ens1f1 txqueuelen 120000 ifconfig ens1f2 txqueuelen 120000 ifconfig ens1f3 txqueuelen 120000
Note:
The above content is an example file, which will change according to host parameters. - Change the permission by performing the following
command:
[root@DSR-X9KVM-1 dispatcher.d]# chmod +x 30_ring_buff
- Use the pre-set maximum of RX and
TX for each interface. Then, add the below script
to file
30_ring_buff
./sbin/ethtool -G <interface-name> rx <RX-Preset Maximum> tx <TX-Preset Maximum> For example: #!/bin/bash /sbin/ethtool -G eth0 rx 4078 tx 4096 /sbin/ethtool -G eth1 rx 4078 tx 4096 /sbin/ethtool -G eth2 rx 4078 tx 4096 /sbin/ethtool -G eth3 rx 4078 tx 4096
Note:
The above example files will change according to host parameters.
- Before setting ring buffer value for VMs, verify the pre-set
maximum value on the hostmachine of RX and TX for all the interfaces using
the following
command:
- Restart all ethernet adapter eth0, eth1, eth2, and eth3 by performing
the following
command:
systemctl restart NetworkManager
- Verify that the ring buffer sizes are set to max on all the ethernet
devices on the host machine by performing the following
command:
# ethtool -g <ethernet adapter>
Verify the same for eth0, eth1, eth2, and eth3.
- Run the following command to verify
txqueue
length for the ethernet adapter to a high value on the host machine that is added on all interfaces.# ifconfig <ethernet adapter>
Note:
These commands were tested on OL7.7 and OL8.9 KVM host machine and might vary for different versions.