qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Li Liang <liang.z.li@intel.com>
Cc: quintela@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org,
	lcapitulino@redhat.com, yang.z.zhang@intel.com,
	amit.shah@redhat.com
Subject: Re: [Qemu-devel] [v2 1/2] docs: Add a doc about multiple compression threads
Date: Thu, 06 Nov 2014 14:46:20 +0100	[thread overview]
Message-ID: <545B7BAC.40904@redhat.com> (raw)
In-Reply-To: <20141106132451.GA20765@work-vm>

[-- Attachment #1: Type: text/plain, Size: 2671 bytes --]

On 11/06/2014 02:24 PM, Dr. David Alan Gilbert wrote:
> * Li Liang (liang.z.li@intel.com) wrote:
>> Give some details about the multiple compression threads and how
>> to use it in live migration.
>>
>> Signed-off-by: Li Liang <liang.z.li@intel.com>
>> ---

>> +TODO
>> +====
>> +Some faster compression/decompression method such as lz4 and quicklz
>> +can help to reduce the CPU consumption when doing (de)compression.
>> +Less (de)compression threads are needed when doing the migration.
> 
> OK, some high level questions:
>    1) How does the performance compare to running a separate compressor
> process in the stream rather than embedding it in the qemu?

Interesting question.  I wonder if libvirt should be extended to
optionally insert a compression/decompression filter in the setups it
creates.  Remember, in libvirt tunnelled mode, where libvirt is adding
TLS encryption on top of the migration data stream so that it is not
sniffable from TCP, all data is already going through the path:

source qemu -> source libvirt -> destination libvirt -> destination qemu
          Unix socket/pipe  TCP socket          Unix socket/pipe

Furthermore, libvirt is ALREADY wired up to use external compression
when doing migration to file (such as supporting multiple compression
formats for 'virsh save'), which looks like:

qemu -> compressor -> libvirt I/O helper -> file
     pipe         pipe           O_DIRECT file ops

then restoring that image with:

file -> libvirt I/O helper -> decompressor -> qemu
  O_DIRECT file ops      pipe             pipe

So adding compression in the mix seems like it would be easy for libvirt
to do:

source qemu -> compressor -> source libvirt -> destination libvirt ...
          pipe           pipe            TCP socket
   -> decompressor -> destination qemu
 pipe             pipe


Of course, with an external processor, I don't know if you can get
speedups from having multiple compression threads when all input is
coming serially from a single connection, so your approach of folding in
parallel compression threads directly into qemu may still have some
speed merits.  On the other hand, I'm not sure how your solution is
multiplexing the multiple compression threads into a single migration
stream; if you are still bottlenecked by a single migration stream, what
good do you get by adding multiple (de)compression threads, without some
way in the migration protocol to cleanly call out a fair rotation from
the independent sub-stream of each thread?

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 539 bytes --]

  reply	other threads:[~2014-11-06 13:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-06 11:08 [Qemu-devel] [PATCH v2 0/2] migration: Add a new feature to do live migration Li Liang
2014-11-06 11:08 ` [Qemu-devel] [v2 1/2] docs: Add a doc about multiple compression threads Li Liang
2014-11-06 11:25   ` Eric Blake
2014-11-06 13:24   ` Dr. David Alan Gilbert
2014-11-06 13:46     ` Eric Blake [this message]
2014-11-07  2:28     ` Li, Liang Z
2014-11-06 11:08 ` [Qemu-devel] [v2 2/2] migration: Implement " Li Liang
2014-11-06 12:57   ` Eric Blake
2014-11-21  6:18     ` Zhang, Yang Z
2014-11-24  2:25     ` Li, Liang Z
2014-11-24 17:16       ` Eric Blake
2014-12-08  6:34     ` Li, Liang Z
2014-12-10  8:23       ` Li, Liang Z
2014-11-06 15:41   ` Dr. David Alan Gilbert
2014-11-21  7:01     ` Li, Liang Z
2014-11-21  7:29   ` ChenLiang
2014-11-21  7:38     ` Li, Liang Z
2014-11-21  8:17       ` ChenLiang
2014-11-21  8:35         ` Li, Liang Z
2014-11-21  8:38         ` ChenLiang
2014-11-21  8:39         ` ChenLiang

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=545B7BAC.40904@redhat.com \
    --to=eblake@redhat.com \
    --cc=amit.shah@redhat.com \
    --cc=armbru@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=liang.z.li@intel.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=yang.z.zhang@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).