Bug 601775

Summary: libvirt: qemu: increase dd block size to speed up domain save
Product: Red Hat Enterprise Linux 6 Reporter: Laine Stump <laine>
Component: libvirtAssignee: Laine Stump <laine>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: berrange, crobinso, dallan, eblake, hbrock, jyang, laine, mjenner, tscofield, yimwang
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0_8_1-10_el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 599091 Environment:
Last Closed: 2010-11-11 14:50:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 599091    
Bug Blocks:    

Description Laine Stump 2010-06-08 15:20:45 UTC
+++ This bug was initially created as a clone of Bug #599091 +++

See https://bugs.launchpad.net/ubuntu/+source/qemu-kvm/+bug/524447/comments/5

Apparently increasing the dd block size greatly increases the speed of the domain save operation.

--- Additional comment from laine on 2010-06-07 13:56:00 EDT ---

commit 20206a4bc9f1293c69eca79290a55a5fa19976d5 in libvirt git changes the dd blocksize to 1M. This decreased the time required for a save of a suspended 512MB guest from 3min47sec to 56sec.

Comment 1 RHEL Program Management 2010-06-08 15:33:23 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 3 Dave Allan 2010-06-24 01:35:53 UTC
libvirt-0_8_1-10_el6 has been built in RHEL-6-candidate with the fix.

Dave

Comment 5 Osier Yang 2010-07-09 09:06:06 UTC
libvirt-0.8.1-increase-dd-block-size.patch
libvirt-0.8.1-reduce-wasted-padding.patch

These two patches fix the problem.

[root@dhcp-66-65-* SOURCES]# rpm -q libvirt
libvirt-0.8.1-13.el6.x86_64

Comment 6 Daniel Berrangé 2010-08-25 16:47:16 UTC
FYI: for people reading this ticket, there was actually an even more serious bug in QEMU itself. It would frequently sleep doing nothing due to small pipe buffer size, destroying performance. So for really fast domain save the QEMU fix is critical

commit 5e77aaa0d7d2f4ceaa4fcaf50f3a26d5150f34a6
Author: Avi Kivity <avi>
Date:   Wed Jul 7 19:44:22 2010 +0300

    QEMUFileBuffered: indicate that we're ready when the underlying file is ready
    
    QEMUFileBuffered stops writing when the underlying QEMUFile is not ready,
    and tells its producer so.  However, when the underlying QEMUFile becomes
    ready, it neglects to pass that information along, resulting in stoppage
    of all data until the next tick (a tenths of a second).
    
    Usually this doesn't matter, because most QEMUFiles used with QEMUFileBuffered
    are almost always ready, but in the case of exec: migration this is not true,
    due to the small pipe buffers used to connect to the target process.  The
    result is very slow migration.

Comment 7 wangyimiao 2010-09-10 02:00:04 UTC
Verified this bug with RHEL6 RC build and it passed:
libvirt-0.8.1-27.el6.x86_64
qemu-img-0.12.1.2-2.113.el6.x86_64
qemu-kvm-0.12.1.2-2.113.el6.x86_64
kernel-2.6.32-71.el6.x86_64

Comment 8 releng-rhel@redhat.com 2010-11-11 14:50:32 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.