From: Fam Zheng <famz@redhat.com>
To: lihuiba <magazine.lihuiba@163.com>
Cc: kwolf@redhat.com, stefanha@redhat.com, qiujian@meituan.com,
qemu-devel@nongnu.org, mengcong@meituan.com
Subject: Re: [Qemu-devel] extremely low IOPS performance of QCOW2 image format on an SSD RAID1
Date: Mon, 23 Jun 2014 11:22:37 +0800 [thread overview]
Message-ID: <20140623032237.GC4638@T430.nay.redhat.com> (raw)
In-Reply-To: <36859ae2.53b9.146c6b7aeab.Coremail.magazine.lihuiba@163.com>
Cc'ing more qcow2 experts.
On Mon, 06/23 11:14, lihuiba wrote:
> >Did you prefill the image? Amplification could come from cluster allocation.
> Yes!
> I forgot to mention that I created the qcow2 image with 'preallocation=metadata', and I have allocated
> the data blocks with dd in VM.
>
>
> Creating image in host:
> qemu-img create -f qcow2 -preallocation=metadata test.qcow2 100G
>
>
> Allocating the blocks in VM:
> dd if=/dev/zero of=/dev/vdb bs=1M
> where vdb is the target image.
>
>
>
>
>
>
>
> At 2014-06-23 11:01:20, "Fam Zheng" <famz@redhat.com> wrote:
> >On Mon, 06/23 10:06, lihuiba wrote:
> >> Hi, all
> >>
> >>
> >> I'm using a qcow2 image stored on a SSD RAID1 (2 x intel S3500), and I'm benchmarking the
> >> system using fio. Although the throughput in VM (with KVM and virtio enabled) is acceptable (67%
> >> of thoughtput in host), the IOPS performance seems is extremely low ---- only 2% of IOPS in host.
> >>
> >>
> >> I was initially using qemu-1.1.2, and I also tried qemu-1.7.1 for comparison. There was no significant
> >> difference.
> >>
> >>
> >> In contrast, raw image and LVM perform very well. They usually achieve 90%+ of throughput and
> >> 60%+ of IOPS. So the problem must lie in the QCOW2 image format.
> >>
> >>
> >> And I observed that, when I perform 4KB IOPS benchmark in VM with a QCOW2 image, fio in VM reports
> >> it is reading 9.x MB/s, while iostat in host reports the SSD is being read 150+ MB/s. So QEMU or QCOW2
> >> must have amplified the amount of read by nearly 16 times.
> >>
> >>
> >> So, how can I fix or tune the performance issue of qcow2?
> >
> >Did you prefill the image? Amplification could come from cluster allocation.
> >
> >Fam
> >
> >>
> >>
> >> Thanks!
> >>
> >>
> >>
> >>
> >> PS:
> >> 1. qemu parameters:
> >> -enable-kvm -cpu qemu64 -rtc base=utc,clock=host,driftfix=none -usb -device usb-tablet -nodefaults -nodefconfig -no-kvm-pit-reinjection -global kvm-pit.lost_tick_policy=discard -machine pc,accel=kvm -vga std -k en-us -smp 8 -m 4096 -boot order=cdn -vnc :1 -drive file=$1,if=none,id=drive_0,cache=none,aio=native -device virtio-blk-pci,drive=drive_0,bus=pci.0,addr=0x5 -drive file=$2,if=none,id=drive_2,cache=none,aio=native -device virtio-blk-pci,drive=drive_2,bus=pci.0,addr=0x7
> >>
> >>
> >> 2. fio parameters for IOPS:
> >> fio --filename=/dev/vdb --direct=1 --ioengine=libaio --iodepth 32 --thread --numjobs=1 --rw=randread --bs=4k --size=100% --runtime=60s --group_reporting --name=test
> >>
> >>
> >> 3. fio parameters for throughput:
> >> fio --filename=/dev/vdb--direct=1 --ioengine=psync --thread --numjobs=3 --rw=randread --bs=1024k --size=100% --runtime=60s --name=randread --group_reporting -name=test
> >>
> >>
> >>
> >
next prev parent reply other threads:[~2014-06-23 3:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-23 2:06 [Qemu-devel] extremely low IOPS performance of QCOW2 image format on an SSD RAID1 lihuiba
2014-06-23 3:01 ` Fam Zheng
2014-06-23 3:14 ` lihuiba
2014-06-23 3:22 ` Fam Zheng [this message]
2014-06-23 6:20 ` lihuiba
2014-06-23 8:25 ` Stefan Hajnoczi
[not found] ` <225b854d.98bc.146ccc39a83.Coremail.magazine.lihuiba@163.com>
2014-06-24 10:15 ` Kevin Wolf
2014-06-23 7:30 ` Stefan Hajnoczi
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=20140623032237.GC4638@T430.nay.redhat.com \
--to=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=magazine.lihuiba@163.com \
--cc=mengcong@meituan.com \
--cc=qemu-devel@nongnu.org \
--cc=qiujian@meituan.com \
--cc=stefanha@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).