So Richard recently blogged about running many libguestfs mounts in parallel. I actually want parallelization in the other way; I use guestmount to access a disk image, and my program is multithreaded. It does read/write and most especially calls to link() and fdatasync() from threads. However, this all ends up being serialized, because the guestfsd protocol is synchronous, and the daemon side is single-threaded. Related to this, the qemu instance is always booted with only one vCPU. Have there been any thoughts on fixing this?
On Tue, Feb 26, 2013 at 09:36:30AM -0500, Colin Walters wrote:
So Richard recently blogged about running many libguestfs mounts in parallel.
I actually want parallelization in the other way; I use guestmount to access a disk image, and my program is multithreaded. It does read/write and most especially calls to link() and fdatasync() from threads.
However, this all ends up being serialized, because the guestfsd protocol is synchronous, and the daemon side is single-threaded. Related to this, the qemu instance is always booted with only one vCPU.
Have there been any thoughts on fixing this?
Yes. However it requires changes to the virtio-serial protocol or perhaps its entire replacement with VMware's vsock protocol (currently being discussed in upstream qemu). Without this, it's pretty clunky to open more than one connection from the library to the appliance. It would also need guestfsd to become multi-threaded. That's not so much of a problem (although it's certainly a bit of work), but solving the protocol problem would have to be done first. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
On Tue, Feb 26, 2013 at 02:56:53PM +0000, Richard W.M. Jones wrote:
On Tue, Feb 26, 2013 at 09:36:30AM -0500, Colin Walters wrote:
So Richard recently blogged about running many libguestfs mounts in parallel.
I actually want parallelization in the other way; I use guestmount to access a disk image, and my program is multithreaded. It does read/write and most especially calls to link() and fdatasync() from threads.
However, this all ends up being serialized, because the guestfsd protocol is synchronous, and the daemon side is single-threaded. Related to this, the qemu instance is always booted with only one vCPU.
Have there been any thoughts on fixing this?
Yes. However it requires changes to the virtio-serial protocol or perhaps its entire replacement with VMware's vsock protocol (currently being discussed in upstream qemu). Without this, it's pretty clunky to open more than one connection from the library to the appliance.
That's if you need to open multiple connections though. Sounds like in Colin's case he just has one multi-threaded app, in which case all apps could just share one connection & have the RPC messages multi-plexed as we do with libvirt. Of course still needs the daemon to be multithreaded to get any benefit from that.
It would also need guestfsd to become multi-threaded. That's not so much of a problem (although it's certainly a bit of work), but solving the protocol problem would have to be done first.
Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
On Tue, Feb 26, 2013 at 03:00:42PM +0000, Daniel P. Berrange wrote:
On Tue, Feb 26, 2013 at 02:56:53PM +0000, Richard W.M. Jones wrote:
On Tue, Feb 26, 2013 at 09:36:30AM -0500, Colin Walters wrote:
So Richard recently blogged about running many libguestfs mounts in parallel.
I actually want parallelization in the other way; I use guestmount to access a disk image, and my program is multithreaded. It does read/write and most especially calls to link() and fdatasync() from threads.
However, this all ends up being serialized, because the guestfsd protocol is synchronous, and the daemon side is single-threaded. Related to this, the qemu instance is always booted with only one vCPU.
Have there been any thoughts on fixing this?
Yes. However it requires changes to the virtio-serial protocol or perhaps its entire replacement with VMware's vsock protocol (currently being discussed in upstream qemu). Without this, it's pretty clunky to open more than one connection from the library to the appliance.
That's if you need to open multiple connections though. Sounds like in Colin's case he just has one multi-threaded app, in which case all apps could just share one connection & have the RPC messages multi-plexed as we do with libvirt. Of course still needs the daemon to be multithreaded to get any benefit from that.
I'm really extremely cautious about making any change to the protocol. I found and fixed yet another bug (a crasher) in it only a few days ago (RHBZ#914931). You'd have thought we would have worked out all the bugs in it after 5 years, but apparently not ... Having parallel connections avoids making any protocol changes (except if you consider parallel connections to be a protocol change, but I guess you know what I mean ...) Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
participants (3)
-
Colin Walters -
Daniel P. Berrange -
Richard W.M. Jones