gmirror: writes are faster than reads

Ian Lepore ian at FreeBSD.org
Thu Nov 28 23:09:58 UTC 2013


On Thu, 2013-11-28 at 21:47 +0100, Szalai András wrote:
> Hi Guys,
> 
> Has somebody encountered (significantly) different read/write speeds
> when using gmirror?
> 
> I have 2xWD WD30EFRX RED drives which are configured as follows:
> 
> $ gmirror status
>         Name    Status  Components
> mirror/root  COMPLETE  ada0p2 (ACTIVE)
>                         ada1p2 (ACTIVE)
> mirror/data  COMPLETE  ada0p4 (ACTIVE)
>                         ada1p4 (ACTIVE)
> 
> mirror/root is mounted as the root fs (UFS2).
> 
> Doing write:
> 
> $ time dd if=/dev/zero of=/IMAGE bs=1024k count=`expr 4 \* 1024`
> 4096+0 records in
> 4096+0 records out
> 4294967296 bytes transferred in 29.326044 secs (146455733 bytes/sec)
> 
> Doing read:
> 
> $ time dd if=/IMAGE of=/dev/null bs=1024k count=`expr 4 \* 1024`
> 4096+0 records in
> 4096+0 records out
> 4294967296 bytes transferred in 48.821649 secs (87972598 bytes/sec)
> 
> As you can see, read is much slower than write (87 vs 146 MB/s). Why?
> 
> 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




More information about the freebsd-stable mailing list