Remix.run Logo
rwmj an hour ago

vsock is pretty widely used, and if you're using virtio-vsock it should be fast. Anyway if you want to do some quick benchmarks and have an existing Linux VM on a libvirt host:

(1) 'virsh edit' the guest and check it has '<vsock/>' in the <devices> section of the XML.

(2) On the host:

  $ nbdkit memory 1G --vsock -f
(3) Inside the guest:

  $ nbdinfo 'nbd+vsock://2'
(You should see the size being 1G)

And then you can try using commands like nbdcopy to copy data into and out of the host RAM disk over vsock. eg:

  $ time nbdcopy /dev/urandom 'nbd+vsock://2' -p
  $ time nbdcopy 'nbd+vsock://2' null: -p
On my machine that's copying at a fairly consistent 20 Gbps, but it's going to depend on your hardware.
gpderetta 11 minutes ago | parent | next [-]

Is nbdcopy actually touching the data consumer side or is splicing to /dev/null ?

imiric 3 minutes ago | parent | prev [-]

Ah, thanks. That is a much better example than the one in the article.