From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzNm0-0001w9-Df for qemu-devel@nongnu.org; Tue, 24 Jun 2014 06:16:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WzNlp-0003f1-Kd for qemu-devel@nongnu.org; Tue, 24 Jun 2014 06:16:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2228) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzNlp-0003en-Bl for qemu-devel@nongnu.org; Tue, 24 Jun 2014 06:16:09 -0400 Date: Tue, 24 Jun 2014 12:15:46 +0200 From: Kevin Wolf Message-ID: <20140624101546.GB3458@noname.redhat.com> References: <35adc553.340a.146c679d395.Coremail.magazine.lihuiba@163.com> <20140623030120.GB4638@T430.nay.redhat.com> <36859ae2.53b9.146c6b7aeab.Coremail.magazine.lihuiba@163.com> <20140623032237.GC4638@T430.nay.redhat.com> <6db7bace.5114.146c761fa69.Coremail.magazine.lihuiba@163.com> <20140623082510.GA9640@stefanha-thinkpad.redhat.com> <225b854d.98bc.146ccc39a83.Coremail.magazine.lihuiba@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <225b854d.98bc.146ccc39a83.Coremail.magazine.lihuiba@163.com> Subject: Re: [Qemu-devel] extremely low IOPS performance of QCOW2 image format on an SSD RAID1 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: lihuiba Cc: qiujian@meituan.com, Fam Zheng , qemu-devel@nongnu.org, Stefan Hajnoczi , mengcong@meituan.com Am 24.06.2014 um 09:25 hat lihuiba geschrieben: > >Can you confirm that making L2_CACHE_SIZE much bigger solves the > >problem? > Yes, it is confirmed. > When I run fio randread with a 7GB or 8GB size, result is close to that of raw image. > But when the size is increased to 9GB, the result drops dramatically. And I have modified > qcow2-cache.c to print a log when cache misses. When testing the 9GB size, there are > lots of cache misses shown. > > >You also have the optional of specifying the cluster size when creating > >the qcow2 image file. A larger cluster size reduces the amount of > >metadata overhead and therefore increases cache hits. > I didn't find any command-line option to increase the size of the cache, so I increased > cluster_size to 1MB or 2MB. This worked very well for me. > > BTW > qemu-img of version 1.7.1 has bug when creating qcow2 image with options preallocation=metadata > and cluster_size > 64K. It reports: > > > # qemu-img create -f qcow2 -o preallocation=metadata,cluster_size=1M asdf.qcow2 100G > Formatting 'asdf.qcow2', fmt=qcow2 size=107374182400 encryption=off cluster_size=1048576 preallocation='metadata' lazy_refcounts=off > qemu-img: block/qcow2-cluster.c:1196: qcow2_alloc_cluster_offset: Assertion `n_start * (1ULL << 9) == offset_into_cluster(s, offset)' failed. This appears to be fixed in current git master. Kevin