DO Ideas 2

Virtio support

Instead of exposing the hard drives as /dev/hda (ide) and the NIC as realtek 8139 chipset I'd like to use virtio. I've been using that extensively on my own systems and its much faster. Is there a plan to make it possible to use virtio instead of IDE and realtek 8139?

  • Alfred Hall
  • Sep 11 2018
  • Shipped
  • Attach files
  • Moisey Uretsky commented
    September 11, 2018 19:32

    We left VirtIO as a user toggle because of the variety of images that are deployed, we default to it being on but ultimately leave to the customer to decide.

    Different distros and versions may behave differently to it which is why we didn't want to force it in the background in case some people ran into issues with particular virtual servers.

  • Jörg Thalheim commented
    September 11, 2018 19:32

    Since I enabled virtio, my machine seems to hang once a day or so (which means no responding to network on all ports, even vnc). After rebooting I saw two times in the system log something services, which were page faulting or had memory issues. I'm using archlinux. Could this been related to virtio?

  • Nicholas Kourtzis commented
    September 11, 2018 19:32

    Same here. I destroyed and rebuilt two of my droplets, enabling VirtIO. I rebuilt them using a snapshot I took just before destroying. All of lshw, lsmod and lspci show exactly the same results on these two droplets, as well as the third one (which was created some time ago, without virtio). Ioping also gives the same results (and actually higher on one of the two rebuilt droplets).

  • Ben commented
    September 11, 2018 19:32

    Well, if I use what Hello71 says, I don't seem to get virtio on Ubuntu 12.04 32-bit. I spun up a couple of droplets, one with virtio checked, and one without. Both the 'ls /dev/[hsv]d[a-c]' and the 'lspci | grep -i virtio' show the same on both.

  • Hello71 commented
    September 11, 2018 19:32

    ls /dev/[hsv]d[a-c]
    lspci | grep -i virtio

  • Moisey Uretsky commented
    September 11, 2018 19:32

    The harddrive and network driver maybe different between the virtIO droplet and non virtio so you can spin up both of your preferred distro and check which each loads and then confirm that against your existing droplet.

    We are also going to be integrating the toggling of VirtIO on/off into the settings section of the droplet menu.

    Thanks

  • Ben commented
    September 11, 2018 19:32

    Is there a way to tell from within the guest whether you're using virtio?

  • Moisey Uretsky commented
    September 11, 2018 19:32

    We have enabled VirtIO for default on all creates both via the CP and the API.

    We've also added documentation to the API on how to enable/disable this during creates.

    Marking as completed. =]

  • Morthawt commented
    September 11, 2018 19:32

    This is enabled on my droplet right now and I can tell everyone that the network reliability is much higher now. Before I could download a test 100MB file at about 13 MB/s but when doing a speed test through my VPN server I would only get a reading of about 3 - 5 Mbit connection speed.

    After my droplet has Virtio enabled I have seen my 100MB test file download much much faster. I actually just did a test and it downloaded at 38.9M/s and when I run a speedtest through speedtest.net I get connection speed readouts of 30 - 50 Mbit.

    Thumbs up from me :D Good work D.O, much more stable experience now.

  • Alex Bradbury commented
    September 11, 2018 19:32

    Given that you are evaluating virtio-net, have you looked at vhost-net for acceleration of the virtio-net driver in the host kernel? Definitely worth looking at, though looks to me like qemu might go with virtio-net with data plane (to match the virtio-blk+dataplane that went in to qemu 1.4).

  • Ali Firdaus commented
    September 11, 2018 19:32

    virtio network and virtio disk was design for virtual machine, I use it when creating vm on smartdata center.

  • Alex Bradbury commented
    September 11, 2018 19:32

    Are your hosts using vhost-net (and your kvm configured to use it?)

  • Moisey Uretsky commented
    September 11, 2018 19:32

    We have not added this functionality to the front-end but you can request virtIO to be enabled on a running droplet by opening a ticket for the time being.

    Thanks!

  • reflexing commented
    September 11, 2018 19:32

    Is it possible to use VirtIO on existing Arch droplet?

  • Moisey Uretsky commented
    September 11, 2018 19:32

    Just open a ticket if you dont see if in your create droplets page and we'll verify you and you'll have access to it.

  • Mattias commented
    September 11, 2018 19:32

    I wonder how far this is from being available. It is almost a month from the Moiseys comment, so it might be not that far. If it would be only a week or so, I'd rather wait for it to be completed before moving in here. Any testers needed?

  • Frederico Araujo commented
    September 11, 2018 19:32

    this looks interesting... virtio is definitely the way to go.

  • Up commented
    September 11, 2018 19:32

    Upvote!

  • Alfred Hall commented
    September 11, 2018 19:32

    @Moisey Thanks for this, will reinstall a droplet with virtio once the custom images feature is ready.

    @Kenn Thanks for the benchmark, this is quite useful.

  • Kenn Ejima commented
    September 11, 2018 19:32

    Guys,

    I have some preliminary benchmark result using hdparm and bonnie++.

    https://gist.github.com/kenn/4741999 - without virtio
    https://gist.github.com/kenn/4742470 - with virtio

    Highlights:

    - Sequential block writes: Comparable
    - Sequential block reads: 2x faster in block reads, CPU is nearing saturation
    - Random Seeks: 1.5x faster, but CPU usage is 29% vs 80% - Virtio is much lighter
    - Sequential file creates: 2x faster
    - Sequential file reads: both are too fast to measure. :)
    - Sequential file deletes: 1.5x faster
    - Random file creates: 1.5x faster
    - Random file reads: too fast :)
    - Random file deletes: 1.5x faster
    - Latency: No notable difference in any tests

    Everything looks better with Virtio, clearly a big win.

  • Moisey Uretsky commented
    September 11, 2018 19:32

    We've deployed virtio as a Labs (Beta) feature for older customers where they can set it during a new droplet create.

    We are going to run with that for a few days and see if there are any odd issues we run into with virtual servers failing to ping after creation and then roll that out to older customers again to reset their running virtual servers to virtio.

    If all of the testing looks good from there then we will continue to roll out more support for more customers for virtio.

    Thanks

  • Alfred Hall commented
    September 11, 2018 19:32

    @Moisey any comments on this, 133 votes is not bad :).

  • Alfred Hall commented
    September 11, 2018 19:32

    It only depends on what parameters they use to kvm and at the moment they're not configurable and are unfortunately set to emulate realtek and IDE. I'm hoping they make this configurable so we can choose virtio. Linux guests are not a problem as virtio is supported in 2.6.30 and after if I remember correctly.

  • Ankur Sethi commented
    September 11, 2018 19:32

    I wonder why virtio is not used, is it the choice of kernel on the guests? It seems to be the official KVM way.

  • Jonathan Tittle commented
    September 11, 2018 19:32

    VirtIO would definitely be nice since it looks like the VPS's are reporting as KVM or HVM with QEMU last I checked. Would love to see this as a standard option.

  • Anonymous commented
    September 11, 2018 19:32

    voted