odd behavior with geom - gmirror - read/write simultaneously

Vasil Dimov vd at FreeBSD.org
Thu Apr 6 06:16:40 UTC 2006


On Wed, Apr 05, 2006 at 03:09:56PM -0300, Thiago Damas wrote:
>   Hi,
>   I'm having a odd behavior while using geom_mirror.
>   I have the following situation:
> - RAID1 with 2 SATA disks
> # gmirror status
>         Name    Status  Components
> mirror/home0  COMPLETE  ad2
>                         ad3
> 
> - home0 as /home
> # df -h
> Filesystem              Size    Used   Avail Capacity  Mounted on
> /dev/ad0s1a             1.9G     74M    1.7G     4%    /
> devfs                   1.0K    1.0K      0B   100%    /dev
> /dev/ad0s1d             989M     16K    910M     0%    /tmp
> /dev/ad0s1e             7.7G    1.9G    5.2G    27%    /usr
> /dev/ad0s1f              58G    139M     53G     0%    /var
> /dev/mirror/home0s1c    226G    7.4G    200G     4%    /home
> 
>   I was testing the read/write speed on /home, with:
> # dd if=/dev/ad0 of=/home/test.data bs=4m
>   While running this, gstat shows me what I wanted:
> # gstat
>  L(q)  ops/s    r/s   kBps   ms/r    w/s   kBps   ms/w   %busy Name
>     0    230    230  29383    1.9      0      0    0.0   42.8| ad0
>     0      0      0      0    0.0      0      0    0.0    0.0| ad0s1
>     9    192      0      0    0.0    192  24529   21.0   65.3| ad2
>     7    196      0      0    0.0    196  25040   16.6   65.4| ad3
>     0      0      0      0    0.0      0      0    0.0    0.0| ad0s1a
>     0      0      0      0    0.0      0      0    0.0    0.0| ad0s1b
>     0      0      0      0    0.0      0      0    0.0    0.0| ad0s1c
>     0      0      0      0    0.0      0      0    0.0    0.0| ad0s1d
>     0      0      0      0    0.0      0      0    0.0    0.0| ad0s1e
>     0      0      0      0    0.0      0      0    0.0    0.0| ad0s1f
>     0      0      0      0    0.0      0      0    0.0    0.0| ad2s1
>     9    192      0      0    0.0    192  24529   21.2   65.4| mirror/home0
>     0      0      0      0    0.0      0      0    0.0    0.0| ad3s1
>     9    192      0      0    0.0    192  24529   21.2   65.4| mirror/home0s1
>     9    192      0      0    0.0    192  24529   22.0   66.6| mirror/home0s1c
> 
>   After that, I test the read speed:
> # dd if=/home/test.data bs=4m of=/dev/null
> # gstat
> dT: 0.501  flag_I 500000us  sizeof 240  i -1
>  L(q)  ops/s    r/s   kBps   ms/r    w/s   kBps   ms/w   %busy Name
>     0      0      0      0    0.0      0      0    0.0    0.0| ad0
>     0      0      0      0    0.0      0      0    0.0    0.0| ad0s1
>     1    120    120  15329    3.7      0      0    0.0   44.9| ad2
>     0    122    122  15584    3.5      0      0    0.0   43.1| ad3
>     0      0      0      0    0.0      0      0    0.0    0.0| ad0s1a
>     0      0      0      0    0.0      0      0    0.0    0.0| ad0s1b
>     0      0      0      0    0.0      0      0    0.0    0.0| ad0s1c
>     0      0      0      0    0.0      0      0    0.0    0.0| ad0s1d
>     0      0      0      0    0.0      0      0    0.0    0.0| ad0s1e
>     0      0      0      0    0.0      0      0    0.0    0.0| ad0s1f
>     0      0      0      0    0.0      0      0    0.0    0.0| ad2s1
>     1    242    242  30913    3.7      0      0    0.0   88.4| mirror/home0
>     0      0      0      0    0.0      0      0    0.0    0.0| ad3s1
>     1    242    242  30913    3.7      0      0    0.0   88.7| mirror/home0s1
>     1    242    242  30913    3.7      0      0    0.0   90.0| mirror/home0s1c
> 
>  And it shows again what was supposed to.
> 
>   Now, I test read/write simultaneously:
> In on shell (1):
> # dd if=/dev/ad0 of=/home/test.data bs=4m
> After some time, in another shell(2)
> # dd if=/home/test.data bs=4m of=/dev/null
>   And gstat shows me the following:
> # gstat
> dT: 0.501  flag_I 500000us  sizeof 240  i -1
>  L(q)  ops/s    r/s   kBps   ms/r    w/s   kBps   ms/w   %busy Name
>     0      0      0      0    0.0      0      0    0.0    0.0| ad0
>     0      0      0      0    0.0      0      0    0.0    0.0| ad0s1
>     0    158    158  20183    3.0      0      0    0.0   47.6| ad2
>     1    158    158  20183    2.5      0      0    0.0   39.1| ad3
>     0      0      0      0    0.0      0      0    0.0    0.0| ad0s1a
>     0      0      0      0    0.0      0      0    0.0    0.0| ad0s1b
>     0      0      0      0    0.0      0      0    0.0    0.0| ad0s1c
>     0      0      0      0    0.0      0      0    0.0    0.0| ad0s1d
>     0      0      0      0    0.0      0      0    0.0    0.0| ad0s1e
>     0      0      0      0    0.0      0      0    0.0    0.0| ad0s1f
>     0      0      0      0    0.0      0      0    0.0    0.0| ad2s1
>     1    315    315  40367    2.8      0      0    0.0   87.4| mirror/home0
>     0      0      0      0    0.0      0      0    0.0    0.0| ad3s1
>     1    315    315  40367    2.8      0      0    0.0   87.8| mirror/home0s1
>     1    315    315  40367    2.8      0      0    0.0   89.4| mirror/home0s1c
> 
> 
>   I'm having NO writes in home0; even hitting ^C in shell(1) hangs,
> until I cancel the dd command in shell(2).
>   I think its happening some problem with geom code . Can someone
> verify this? I using 6.1 PRERELEASE, with GENERIC kernel.
> 

Did you try the parallel dd commands on another partition which is not
gmirror'd? For example:

dd if=/dev/ad0 of=/var/tmp/test.data bs=4m
dd if=/var/tmp/test.data bs=4m of=/dev/null

So you can be sure that it is a gmirror issue.

When I try your test on my mirror gstat shows read and write activity,
but the reading dd quits very soon, because reading appears to be faster
than writing.

I would suggest that you write to one file and read from another file
when you do the parallel test.

Just a hint: for the write test you should better use /dev/zero instead
of /dev/ad0 - ``dd if=/dev/zero of=/home/test.data bs=4m'' for obvious
reasons.

-- 
Vasil Dimov
gro.DSBeerF at dv

Testing can show the presence of bugs, but not their absence.
                -- Edsger W. Dijkstra
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 155 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20060406/9b3cf145/attachment.pgp


More information about the freebsd-hackers mailing list