From nobody@FreeBSD.org  Fri Mar 23 19:52:22 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 95C1F16A401
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 23 Mar 2007 19:52:22 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 85D5913C468
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 23 Mar 2007 19:52:22 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l2NJqMk6055084
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 23 Mar 2007 19:52:22 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l2NJlL2b054162;
	Fri, 23 Mar 2007 19:47:21 GMT
	(envelope-from nobody)
Message-Id: <200703231947.l2NJlL2b054162@www.freebsd.org>
Date: Fri, 23 Mar 2007 19:47:21 GMT
From: Mykola Zubach<zuborg@advancedhosters.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: gmirror read speed is half of maximum
X-Send-Pr-Version: www-3.0

>Number:         110729
>Category:       bin
>Synopsis:       gmirror(8): gmirror read speed is half of maximum
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-geom
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar 23 20:00:09 GMT 2007
>Closed-Date:    Fri Mar 23 20:44:33 GMT 2007
>Last-Modified:  Fri Mar 23 20:44:33 GMT 2007
>Originator:     Mykola Zubach
>Release:        FreeBSD 6.2
>Organization:
AdvancedHosters.com
>Environment:
FreeBSD A0022 6.2-RELEASE FreeBSD 6.2-RELEASE #2: Mon Jan 29 15:06:29 UTC 2007     root@A00014:/usr/src/sys/i386/compile/Z  i386

>Description:
A0022# gmirror list
Geom name: gm0
State: COMPLETE
Components: 2
Balance: round-robin
Slice: 4096
Flags: NOAUTOSYNC
GenID: 0
SyncID: 1
ID: 2775573558
Providers:
1. Name: mirror/gm0
   Mediasize: 250059349504 (233G)
   Sectorsize: 512
   Mode: r7w7e8
Consumers:
1. Name: ad4
   Mediasize: 250059350016 (233G)
   Sectorsize: 512
   Mode: r1w1e1
   State: ACTIVE
   Priority: 0
   Flags: DIRTY
   GenID: 0
   SyncID: 1
   ID: 3586241583
2. Name: ad6
   Mediasize: 250059350016 (233G)
   Sectorsize: 512
   Mode: r1w1e1
   State: ACTIVE
   Priority: 0
   Flags: DIRTY
   GenID: 0
   SyncID: 1
   ID: 787590598

I run gstat to see disk activity

dd if=/dev/mirror/gm0 of=/dev/null bs=64k
 L(q)  ops/s    r/s   kBps   ms/r    w/s   kBps   ms/w   %busy Name
    0    602    602  38557    0.6      0      0    0.0   34.2| ad4
    1    601    601  38433    1.0      0      0    0.0   59.8| ad6
    1   1203   1203  76990    0.8      0      0    0.0   96.2| mirror/gm0

read speed while doing such test is equal to read speed from single disk, like
dd if=/dev/ad4 of=/dev/null bs=64k
 L(q)  ops/s    r/s   kBps   ms/r    w/s   kBps   ms/w   %busy Name
    1   1302   1302  83321    0.7      0      0    0.0   95.7| ad4

But if I run two dd from both disks - both disks are readed on full speed, so
total read speed is doubled, like it could be in correct RAID1 implementation
 L(q)  ops/s    r/s   kBps   ms/r    w/s   kBps   ms/w   %busy Name
    1   1270   1270  81274    0.8      0      0    0.0   96.1| ad4
    1   1231   1231  78804    0.8      0      0    0.0   96.3| ad6


This behavior does not depend on what kind of disks are used (PATA, SATA,
SCSI..), on what controllers resides these disks (ad0 on ata0 and ad4 on
ata1), on balance method (round-robin, prefer, split etc)

I think it would be nice for gmirror to provide full doubled speed of
reading data from disks, like in hardware raids
>How-To-Repeat:
setup gmirror on any system
>Fix:

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-geom 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Mar 23 20:36:50 UTC 2007 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=110729 
State-Changed-From-To: open->closed 
State-Changed-By: pjd 
State-Changed-When: Fri Mar 23 20:43:26 UTC 2007 
State-Changed-Why:  
This is how RAID1 and disks work. For more detailed explanation, 
please refer to: 

http://lists.freebsd.org/pipermail/freebsd-stable/2005-May/014814.html 

http://www.freebsd.org/cgi/query-pr.cgi?pr=110729 
>Unformatted:
