Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Increasing KVM network interface to 1Gbps

  1. #1
    Join Date
    Apr 2012
    Beans
    78

    Increasing KVM network interface to 1Gbps

    Xubuntu: 20.04
    virt-manager: 1:2.2.1-3ubuntu2.1
    virt-viewer: 7.0-2build1
    qemu: 1:4.2.3ubuntu6.15

    My network was recently upgraded with a 1Gbps router, and in the process of testing various machines for throughput I noticed that my Windows 10 system running under QEMU/KVM on one machine was throttled at 100Mbps. I looked into this and see that it is using a virtual Realtek rtl8139 device for the NIC which is set to Bridge br0: Host device eth1. So even though I have 1Gbps physical Ethernet on my network and motherboard, this interface appears to be the bottleneck. Maybe there is a reason for this configuration, or maybe, out of ignorance, I set it up incorrectly initially. I'm wondering if there is a way to alter the settings to increase throughput and get closer to 1Gbps? Should I change this device to virtio or e1000 (or something else) and is this advised? Does Windows 10 work with these other virtual devices and/or are there a negative system load impact from doing this? Is there anything else I need to be aware of? Thanks for any pointer you can offer.

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Increasing KVM network interface to 1Gbps

    Don't use Realtek rtl8139.

    Always select the virtio drivers for storage controllers and NICs. Do this regardless of the physical device. Do it now. Today.

    I don't know about Win10, but there were virtio drivers available from Redhat. https://www.linux-kvm.org/page/Windo...wnload_Drivers
    I always found the automatically created bridge to be slower than a manually created one. I don't know how to do that with netplan, which is what 20.04 uses. My VM hosts are all 18.04, recently upgraded from 16.04.

    And for all your desktop VMs, when you want remote desktop access into them on the LAN (not over the internet), use the SPICE protocol in the VM settings and QXL video drivers inside the VM. Nearly native performance for everything except gaming.

    Popular Linux desktop distros all come with virtio NIC, disk controller drivers, and QXL display built-in. Basically, we don't have to do anything inside the linux clients for those to work.
    99% of the time, I use ssh into my VMs. Spice is used seldom and over an ssh-tunnel setup using virt-viewer.

    For local connections (running on the VMhost connecting to a Guest VM):
    Code:
    /usr/bin/virt-viewer -a -d  {vm-name} &
    For remote connections:
    Code:
     /usr/bin/virt-viewer --connect qemu+ssh://{vm-hostname}/system {vm-name} &
    Last edited by TheFu; April 30th, 2021 at 12:48 AM.

  3. #3
    Join Date
    Apr 2014
    Location
    Tucson AZ, USA
    Beans
    1,057
    Distro
    Ubuntu

    Re: Increasing KVM network interface to 1Gbps

    I always found the automatically created bridge to be slower than a manually created one. I don't know how to do that with netplan, which is what 20.04 uses. My VM hosts are all 18.04, recently upgraded from 16.04.


    This is what I use on my desktop which is Ubuntu 20.04 desktop with pci pass through for a windows kvm virtual machine that I do my games on.

    Code:
    network:
     version: 2
     renderer: networkd
     ethernets:
      eth0:
       dhcp4: false
       dhcp6: false
     bridges:
      br0:
        interfaces: [eth0]
        dhcp4: false
        dhcp6: false
        addresses: [192.168.1.15/24]
        gateway4: 192.168.1.1
        nameservers:
         addresses: [192.168.1.1]

  4. #4
    Join Date
    Apr 2012
    Beans
    78

    Re: Increasing KVM network interface to 1Gbps

    I installed the virtio-win-0.1.185.iso image and finally figured out how to update all the drivers*. The Ethernet is using the virtio device and Properties is now reporting 10Gbps. When I run a browser speed test, I'm getting around 300Mbps (which is 5-6 times faster than what i was getting before!), vs. another native Windows 10 machine hardwired to my network which gets 900+Mbps which is similar to my Xubuntu machine. Is this the kind of performance I should expect or do you think there is a problem and throughput should be higher than this?

    Thanks for pointing me in the right direction regarding these drivers. I don't know why I never ran across this issue before. I didn't even know that upgrading like this was an option!





    * It's a shame that this driver installation process cannot be better automated and installed as part of the native VM software. It's not too difficult once you've been through it and look back, but no single set of instructions matched my configuration, so there was a lot of work to do to figure out what was actually being described.

  5. #5
    Join Date
    Apr 2012
    Beans
    78

    Re: Increasing KVM network interface to 1Gbps

    Tadaen_Sylvermane:

    Out of curiosity, where is this code located on your system? On my system there is nothing like it in the XML file for the VM under /etc/libvirt/qemu.

  6. #6
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Increasing KVM network interface to 1Gbps

    Quote Originally Posted by cjsmall View Post
    I installed the virtio-win-0.1.185.iso image and finally figured out how to update all the drivers*. The Ethernet is using the virtio device and Properties is now reporting 10Gbps. When I run a browser speed test, I'm getting around 300Mbps (which is 5-6 times faster than what i was getting before!), vs. another native Windows 10 machine hardwired to my network which gets 900+Mbps which is similar to my Xubuntu machine. Is this the kind of performance I should expect or do you think there is a problem and throughput should be higher than this?

    Thanks for pointing me in the right direction regarding these drivers. I don't know why I never ran across this issue before. I didn't even know that upgrading like this was an option!

    * It's a shame that this driver installation process cannot be better automated and installed as part of the native VM software. It's not too difficult once you've been through it and look back, but no single set of instructions matched my configuration, so there was a lot of work to do to figure out what was actually being described.
    Upgrading like what? I'm confused? Do you mean picking better virtual hardware? That's normal for every hypervisor. The KVM performance tuning website spells out some other things that can be done to improve performance.

    On the same physical host, I see 20Gbps+ using virtio drivers.
    Code:
    $ iperf3  -c hadar
    Connecting to host hadar, port 5201
    [  5] local 172.22.22.3 port 35424 connected to 172.22.22.6 port 5201
    ....
    [ ID] Interval           Transfer     Bitrate         Retr
    [  5]   0.00-10.00  sec  27.0 GBytes  23.2 Gbits/sec    0             sender
    [  5]   0.00-10.00  sec  27.0 GBytes  23.2 Gbits/sec                  receiver
    iperf Done.
    I've seen 34Gbps when the host wasn't busy. It is transcoding some videos now.

    With Windows, drivers are just too much hassle. When there is a boot issue, you'll consider whether using virtio was a smart choice. I sometimes wish I'd gone with PRO/1000 and SCSI drivers instead, because those are built-into Windows. When Windows won't boot, you'll need to load drivers, since MSFT hasn't decided that virtio drivers should be default. Every hypervisor supports them - well, perhaps whatever hypervisor MSFT makes doesn't, but all the others do.

    Linux has virtio support built-in and has for 10 yrs or so. It is only a Microsoft OS problem and only Microsoft can fix it. Complain to them. While you are at it, complain that they don't provide ssh-copy-id too! It took them about 20 yrs to support ssh and they left off that tool?

    In general, I don't have to install **any** VM specific stuff for my Linux VM systems to fly.
    Last edited by TheFu; May 2nd, 2021 at 03:11 AM.

  7. #7
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Increasing KVM network interface to 1Gbps

    netplan config files go into /etc/netplan/ ...

  8. #8
    Join Date
    Apr 2012
    Beans
    78

    Re: Increasing KVM network interface to 1Gbps

    Never used or ran across netplan before. All my network hardware interfaces were automatically configured years ago when Ubuntu was first installed and I simply configure new machines by setting up the hosts, networks, etc. files. Does netplan just automate this or is it doing something more?

    There currently are no files under /etc/netplan/. Is there a way to auto-generate a 00-installer-config.yaml file that is an accurate snapshot of the existing network configuration? I saw nothing for this in the manpages or the documents I read online.

  9. #9
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Increasing KVM network interface to 1Gbps

    A fresh install of 20.04 Server asks for network configuration information if you don't use DHCP. Answer those questions correctly and it will create a netplan.yaml file and might work. Netplan was introduced around 17.10, but upgrades from 16.04 --> 18.04 don't force a switch. I don't know about 20.04. Haven't done any upgrades to that release, only a few fresh installations.

    If you change the virtual network adapter from a slow one to virtio, doesn't the network subsystem on Xubuntu pick that up and make it work?

    Answers for many questions are different depending on whether it is a desktop install or a server install.
    For desktops, perhaps someone else will explain for the Xubuntu Desktop Users Guide will have answers? IDK.
    I don't use network-manager to manage my network settings on any Ubuntu, so I'm not the best person to ask about that. Sorry.

  10. #10
    Join Date
    Apr 2014
    Location
    Tucson AZ, USA
    Beans
    1,057
    Distro
    Ubuntu

    Re: Increasing KVM network interface to 1Gbps

    Is this an upgrade from 16.04 or previous? If so then that is likely the issue. The upgrade to 18.04 didn't automatically switch to netplan. It's something you needed to do manually. You may still be on ifupdown (right name?). On a desktop install there should at least be a minumum config file like this when done from 18.04 > now.

    Code:
    network:
     version: 2
     renderer: NetworkManager
    On a server if you did a static ip during install it should look like this. Adjust to match your configuration of course.

    Code:
    network:
     version: 2
     renderer: networkd
     ethernets:
      eth0:
       dhcp4: false
       dhcp6: false
       addresses: [192.168.1.10/24]
       gateway4: 192.168.1.1
       nameservers:
        addresses: [8.8.8.8, 8.8.4.4]
    https://itectec.com/ubuntu/ubuntu-ho...6-04-to-18-04/
    Last edited by Tadaen_Sylvermane; May 4th, 2021 at 03:25 AM.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •