From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Claudio Fontana <cfontana@suse.de>
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
qemu-devel <qemu-devel@nongnu.org>,
"Juan Quintela" <quintela@redhat.com>
Subject: Re: starting to look at qemu savevm performance, a first regression detected
Date: Mon, 7 Mar 2022 12:28:13 +0000 [thread overview]
Message-ID: <YiX6XSlVNw183PTV@work-vm> (raw)
In-Reply-To: <5b3d17d2-f07f-8cb1-54ff-6a517dc4eaef@suse.de>
* Claudio Fontana (cfontana@suse.de) wrote:
> On 3/7/22 1:20 PM, Daniel P. Berrangé wrote:
> > On Mon, Mar 07, 2022 at 01:09:55PM +0100, Claudio Fontana wrote:
> >> On 3/7/22 1:00 PM, Daniel P. Berrangé wrote:
> >>> On Mon, Mar 07, 2022 at 12:19:22PM +0100, Claudio Fontana wrote:
> >>>> On 3/7/22 10:51 AM, Daniel P. Berrangé wrote:
> >>>>> On Mon, Mar 07, 2022 at 10:44:56AM +0100, Claudio Fontana wrote:
> >>>>>> Hello Daniel,
> >>>>>>
> >>>>>> On 3/7/22 10:27 AM, Daniel P. Berrangé wrote:
> >>>>>>> On Sat, Mar 05, 2022 at 02:19:39PM +0100, Claudio Fontana wrote:
> >>>>>>>>
> >>>>>>>> Hello all,
> >>>>>>>>
> >>>>>>>> I have been looking at some reports of bad qemu savevm performance in large VMs (around 20+ Gb),
> >>>>>>>> when used in libvirt commands like:
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> virsh save domain /dev/null
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> I have written a simple test to run in a Linux centos7-minimal-2009 guest, which allocates and touches 20G mem.
> >>>>>>>>
> >>>>>>>> With any qemu version since around 2020, I am not seeing more than 580 Mb/Sec even in the most ideal of situations.
> >>>>>>>>
> >>>>>>>> This drops to around 122 Mb/sec after commit: cbde7be900d2a2279cbc4becb91d1ddd6a014def .
> >>>>>>>>
> >>>>>>>> Here is the bisection for this particular drop in throughput:
> >>>>>>>>
> >>>>>>>> commit cbde7be900d2a2279cbc4becb91d1ddd6a014def (HEAD, refs/bisect/bad)
> >>>>>>>> Author: Daniel P. Berrangé <berrange@redhat.com>
> >>>>>>>> Date: Fri Feb 19 18:40:12 2021 +0000
> >>>>>>>>
> >>>>>>>> migrate: remove QMP/HMP commands for speed, downtime and cache size
> >>>>>>>>
> >>>>>>>> The generic 'migrate_set_parameters' command handle all types of param.
> >>>>>>>>
> >>>>>>>> Only the QMP commands were documented in the deprecations page, but the
> >>>>>>>> rationale for deprecating applies equally to HMP, and the replacements
> >>>>>>>> exist. Furthermore the HMP commands are just shims to the QMP commands,
> >>>>>>>> so removing the latter breaks the former unless they get re-implemented.
> >>>>>>>>
> >>>>>>>> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> >>>>>>>> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> >>>>>>>
> >>>>>>> That doesn't make a whole lot of sense as a bisect result.
> >>>>>>> How reliable is that bisect end point ? Have you bisected
> >>>>>>> to that point more than once ?
> >>>>>>
> >>>>>> I did run through the bisect itself only once, so I'll double check that.
> >>>>>> The results seem to be reproducible almost to the second though, a savevm that took 35 seconds before the commit takes 2m 48 seconds after.
> >>>>>>
> >>>>>> For this test I am using libvirt v6.0.0.
> >>>
> >>> I've just noticed this. That version of libvirt is 2 years old and
> >>> doesn't have full support for migrate_set_parameters.
> >>>
> >>>
> >>>> 2022-03-07 10:47:20.145+0000: 134386: info : qemuMonitorIOWrite:452 : QEMU_MONITOR_IO_WRITE: mon=0x7fa4380028a0 buf={"execute":"migrate_set_speed","arguments":{"value":9223372036853727232},"id":"libvirt-19"}^M
> >>>> len=93 ret=93 errno=0
> >>>> 2022-03-07 10:47:20.146+0000: 134386: info : qemuMonitorJSONIOProcessLine:240 : QEMU_MONITOR_RECV_REPLY: mon=0x7fa4380028a0 reply={"id": "libvirt-19", "error": {"class": "CommandNotFound", "desc": "The command migrate_set_speed has not been found"}}
> >>>> 2022-03-07 10:47:20.147+0000: 134391: error : qemuMonitorJSONCheckError:412 : internal error: unable to execute QEMU command 'migrate_set_speed': The command migrate_set_speed has not been found
> >>>
> >>> We see the migrate_set_speed failing and libvirt obviously ignores that
> >>> failure.
> >>>
> >>> In current libvirt migrate_set_speed is not used as it properly
> >>> handles migrate_set_parameters AFAICT.
> >>>
> >>> I think you just need to upgrade libvirt if you want to use this
> >>> newer QEMU version
> >>>
> >>> Regards,
> >>> Daniel
> >>>
> >>
> >> Got it, this explains it, sorry for the noise on this.
> >>
> >> I'll continue to investigate the general issue of low throughput with virsh save / qemu savevm .
> >
> > BTW, consider measuring with the --bypass-cache flag to virsh save.
> > This causes libvirt to use a I/O helper that uses O_DIRECT when
> > saving the image. This should give more predictable results by
> > avoiding the influence of host I/O cache which can be in a differnt
> > state of usage each time you measure. It was also intended that
> > by avoiding hitting cache, saving the memory image of a large VM
> > will not push other useful stuff out of host I/O cache which can
> > negatively impact other running VMs.
> >
> > Also it is possible to configure compression on the libvirt side
> > which may be useful if you have spare CPU cycles, but your storage
> > is slow. See 'save_image_format' in the /etc/libvirt/qemu.conf
> >
> > With regards,
> > Daniel
> >
>
> Hi Daniel, thanks for these good info,
>
> regarding slow storage, for these tests I am saving to /dev/null to avoid having to take storage into account
> (and still getting low bandwidth unfortunately) so I guess compression is out of the question.
What type of speeds do you get if you try a migrate to a netcat socket?
Dave
> Thanks!
>
> Claudio
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2022-03-07 12:33 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <8826b03d-e5e9-0e65-cab7-ea1829f48e6c@suse.de>
[not found] ` <YiXQHIWtHx5BocxK@redhat.com>
[not found] ` <62ba8b1e-d641-5b10-c1b3-54b7d5a652e7@suse.de>
[not found] ` <YiXVh1P4oJNuEtFM@redhat.com>
2022-03-07 11:19 ` starting to look at qemu savevm performance, a first regression detected Claudio Fontana
2022-03-07 12:00 ` Daniel P. Berrangé
2022-03-07 12:09 ` Claudio Fontana
2022-03-07 12:20 ` Daniel P. Berrangé
2022-03-07 12:26 ` Claudio Fontana
2022-03-07 12:28 ` Dr. David Alan Gilbert [this message]
2022-03-09 11:15 ` bad qemu savevm to /dev/null performance (600 MiB/s max) (Was: Re: starting to look at qemu savevm performance, a first regression detected) Claudio Fontana
2022-03-09 11:43 ` Dr. David Alan Gilbert
2022-03-09 11:51 ` Daniel P. Berrangé
2022-03-09 14:22 ` Claudio Fontana
2022-03-09 18:27 ` bad virsh save /dev/null performance (600 MiB/s max) Claudio Fontana
2022-03-09 18:37 ` Daniel P. Berrangé
2022-03-09 18:39 ` Dr. David Alan Gilbert
2022-03-09 18:47 ` Claudio Fontana
2022-03-09 18:53 ` Dr. David Alan Gilbert
2022-03-09 18:46 ` Daniel P. Berrangé
2022-03-10 15:25 ` Claudio Fontana
2022-03-09 13:16 ` bad qemu savevm to /dev/null performance (600 MiB/s max) (Was: Re: starting to look at qemu savevm performance, a first regression detected) Claudio Fontana
2022-03-05 13:20 starting to look at qemu savevm performance, a first regression detected Claudio Fontana
2022-03-05 14:11 ` Claudio Fontana
2022-03-07 10:32 ` Dr. David Alan Gilbert
2022-03-07 11:06 ` Claudio Fontana
2022-03-07 11:31 ` Dr. David Alan Gilbert
2022-03-07 12:07 ` Claudio Fontana
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=YiX6XSlVNw183PTV@work-vm \
--to=dgilbert@redhat.com \
--cc=berrange@redhat.com \
--cc=cfontana@suse.de \
--cc=qemu-devel@nongnu.org \
--cc=quintela@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 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).