From owner-freebsd-stable@FreeBSD.ORG Thu Nov 28 23:09:58 2013 Return-Path: Delivered-To: freebsd-stable@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 59DE297A for ; Thu, 28 Nov 2013 23:09:58 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2A1E51A49 for ; Thu, 28 Nov 2013 23:09:57 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1VmAiV-0006sx-87; Thu, 28 Nov 2013 23:09:51 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id rASN9m5m009465; Thu, 28 Nov 2013 16:09:48 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/qEUJ8BevLcP2vk5J4rqP2 Subject: Re: gmirror: writes are faster than reads From: Ian Lepore To: Szalai =?ISO-8859-1?Q?Andr=E1s?= In-Reply-To: <5297ABD5.5060504@gmail.com> References: <5297ABD5.5060504@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" Date: Thu, 28 Nov 2013 16:09:48 -0700 Message-ID: <1385680188.58852.8.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by damnhippie.dyndns.org id rASN9m5m009465 Cc: freebsd-stable@FreeBSD.org X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Nov 2013 23:09:58 -0000 On Thu, 2013-11-28 at 21:47 +0100, Szalai Andr=E1s wrote: > Hi Guys, >=20 > Has somebody encountered (significantly) different read/write speeds > when using gmirror? >=20 > I have 2xWD WD30EFRX RED drives which are configured as follows: >=20 > $ gmirror status > Name Status Components > mirror/root COMPLETE ada0p2 (ACTIVE) > ada1p2 (ACTIVE) > mirror/data COMPLETE ada0p4 (ACTIVE) > ada1p4 (ACTIVE) >=20 > mirror/root is mounted as the root fs (UFS2). >=20 > Doing write: >=20 > $ time dd if=3D/dev/zero of=3D/IMAGE bs=3D1024k count=3D`expr 4 \* 1024= ` > 4096+0 records in > 4096+0 records out > 4294967296 bytes transferred in 29.326044 secs (146455733 bytes/sec) >=20 > Doing read: >=20 > $ time dd if=3D/IMAGE of=3D/dev/null bs=3D1024k count=3D`expr 4 \* 1024= ` > 4096+0 records in > 4096+0 records out > 4294967296 bytes transferred in 48.821649 secs (87972598 bytes/sec) >=20 > As you can see, read is much slower than write (87 vs 146 MB/s). Why? >=20 > Any help would be appreciated. You can't use dd to a file to measure performance -- you're just measuring the behavior of the filesystem caching. Much, perhaps most, of the actual writing to disk happens long after the dd command has ended. If you followed the dd command with an unmount of the filesystem and included the time until the umount command completes, you'd have a much closer measure. -- Ian