From: Zhang Shuaiyi <zhang_syi@163.com>
To: qemu-devel@nongnu.org
Cc: stefanha@redhat.com
Subject: [Qemu-devel] Measure virtio-vsock speed
Date: Thu, 15 Dec 2016 17:00:35 +0800 [thread overview]
Message-ID: <871sx9pj0o.fsf@163.com> (raw)
I used kernel 4.8 and qemu v2.8.0-rc3.
Qemu command line:
-device vhost-vsock-pci,id=vhost-vsock-pci0,guest-cid=3
I try to use nc-vsock to test vsock speed.
1. In host:
# modprobe vhost-vsock
# ./nc-vsock -l 1234 > /dev/null
2. In guest:
a. use pv and nc-vsock, speed is about 62MB/s.
# pv /dev/zero | ./nc-vsock 3 1234
b. use dd and nc-vsock, speed is about 67MB/s.
# dd if=/dev/zero bs=1M count=2000 | ./nc-vsock 3 1234
I think nc-vsock can not get the maximum speed, so I modified
nc-vsock.c.
1. In host, just recv data without printf.
2. In guest, use gettimeofday to record interval and send zero bufs.
#define MAXLEN 65536
char buf[MAXLEN] = {0};
unsigned long long num = 0;
gettimeofday(&start_time, NULL);
for (n = 0; n 1000000; n++) {
ret = send(fd, buf, MAXLEN, 0);
if (ret 0) {
fprintf(stderr, "send error ret:%d\n", ret);
break;
}
num += ret;
}
gettimeofday(&end_time, NULL);
In this way, the virtio-vsock speed is about 500MB/s. But use iperf to
test virtio-net, the speed is about 1.5GB/s.
Iperf can be used to test virtio-net, is there a tool to test maximum virtio-vsock speed?
At present, virtio-vsock is faster than virtio-net?
next reply other threads:[~2016-12-15 11:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-15 9:00 Zhang Shuaiyi [this message]
2016-12-16 10:43 ` [Qemu-devel] Measure virtio-vsock speed Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871sx9pj0o.fsf@163.com \
--to=zhang_syi@163.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.