Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Nov 2013 16:09:48 -0700
From:      Ian Lepore <ian@FreeBSD.org>
To:        Szalai =?ISO-8859-1?Q?Andr=E1s?= <szalai.bandi@gmail.com>
Cc:        freebsd-stable@FreeBSD.org
Subject:   Re: gmirror: writes are faster than reads
Message-ID:  <1385680188.58852.8.camel@revolution.hippie.lan>
In-Reply-To: <5297ABD5.5060504@gmail.com>
References:  <5297ABD5.5060504@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1385680188.58852.8.camel>