On Sat, Nov 30, 2019 at 02:17:06AM +0200, Nir Soffer wrote:
Previously we measured the total time and used it to calculate the
rate
of different operations. This is incorrect and hides the real
throughput. A more useful way is to measure the time we spent in each
operation.
Here is an example run with this change:
$ ./nbdkit --foreground \
--unix /tmp/nbd.sock \
--exportname '' \
--filter stats \
file file=/var/tmp/dst.img \
statsfile=/dev/stderr \
--run 'qemu-img convert -p -n -f raw -O raw -T none /var/tmp/fedora-30.img
nbd:unix:/tmp/nbd.sock'
(100.00/100%)
elapsed time: 2.150 s
write: 1271 ops, 1.14 GiB, 0.398 s, 2922.22 MiB/s
zero: 1027 ops, 4.86 GiB, 0.012 s, 414723.03 MiB/s
extents: 1 ops, 2.00 GiB, 0.000 s, 120470559.51 MiB/s
This show that the actual time waiting for storage was only 0.4 seconds,
but elapsed time was 2.1 seconds. I think the missing time is in flush()
which we do not measure yet.
I think opinions differ here. Some people will want to know the
throughput being achieved by the system, and some people will want to
know how well the plugin/backend is performing single operations. I
know that you're interested in benchmarking imageio and that's
completely valid, but I'm interested in measuring the total
throughput. IOW: Can't we show both?
The rest of the code is screaming out to be refactored so we aren't
repeating the same change over and over. How about using something
like the attached patch as an initial refactoring?
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v