EasyManua.ls Logo

Netgate 5100 - Page 63

Netgate 5100
66 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Product Manual, TNSR 19.02
KVM Optimization
Virtio interfaces use tap as a backend, which requires a memcpy() of each packet forwarded. Due to this design,
the stock configuration can result in poor performance. The tuning suggestions in this section will help obtain higher
performance in these environments.
Note: Though these suggested changes have been found to improve performance in testing, every installation and
workload is different. Real-world results may vary depending on the environment. Generally speaking, values should
only be changed from the defaults in cases where performance is lower than expected.
Set the vhost backend driver rx_queue_size and tx_queue_size values to 1024 instead of the default
256.
To set these values in the libvirt xml configuration for a VM, see Changing VM Parameters.
Increase the number of queues in the vhost backend driver configuration, especially if TNSR is configured
to use worker threads. This information is also in the section linked above.
Try using SR-IOV VFs instead of Virtio interfaces.
Try using a DPDK accelerated OpenVSwitch (OVS-DPDK) instead of a standard linux bridge.
Changing VM Parameters
Some values must be changed by editing the VM settings XML directly. This includes the receive and transmit ring
queue sizes and the number of queues.
When setting the receive and transmit ring queue sizes, keep in mind that some environments impose specific require-
ments on the values. For example, they may only work with certain drivers, or may have value restrictions such as
being a power of 2 (256, 512, 1024, etc.).
To edit the VM XML parameters, use the following command:
# virsh edit TNSR
[...]
Find the interface tag(s) and the driver tags inside. In the driver tag, edit or add the desired attributes and
values. For example, to set 5 queues, and 1024 size transmit and receive ring queue sizes:
<interface [...]>
[...]
<driver name='vhost' txmode='iothread' ioeventfd='on' event_idx='off'
queues='5' rx_queue_size='1024' tx_queue_size='1024'>
[...]
</driver>
[...]
</interface>
Note: Details of the above XML block have been omitted for brevity and generality. Interfaces will vary in their
specific settings.
Start the VM, and check the qemu command line, which should contain rx_queue_size=1024,
tx_queue_size=1024.
From within the VM, at a shell prompt, confirm the ring queue sizes
1.3. Virtual Machines 61