Linux RAID subsystem development
 help / color / mirror / Atom feed
* RAID1 write-behind not working?
@ 2009-03-26  0:39 David Rees
       [not found] ` <49CB7CB2.1020105@tmr.com>
  2009-03-27  4:29 ` Neil Brown
  0 siblings, 2 replies; 5+ messages in thread
From: David Rees @ 2009-03-26  0:39 UTC (permalink / raw)
  To: linux-raid

I picked up a SSD (30GB OCZ Vertex if you're curious) and am planning
to set up a RAID1 with it and a SATA disk with the SATA disk in
write-mostly mode along with write-behind enabled.

So I went to test it to make sure I had all the details correct on
aligning the partition to a 128kB offset and the correct mdadm
commands to create the array in write-mostly and write-behind, but I
found that I couldn't get writes to "write-behind".  Essentially all
writes would complete at the speed of the rotating disk.  Reads
however worked great - they all appeared to be coming from the SSD.

I created the array with the following command:

mdadm --create /dev/md0 --raid-devices=2 --level=1 \
  --bitmap=internal --write-behind /dev/sdb1 --write-mostly /dev/sda1

/dev/sda is the SATA disk, /dev/sdb is the SSD.

So then I created an ext3 filesystem on the array (mkfs -t ext3 -E
stride=32 /dev/md0), mounted it and proceeded to run some quick dd
tests to verify that things were working as expected.

I simply wrote a 1kB file to disk like this:
dd if=/dev/zero of=/mnt/disk/tmpfile bs=1k count=1 conv=fdatasync

I tried various file sizes, and even tried reconfiguring the bitmap
with a write-behind setting of 10000.
I confirmed speeds by failing and removing either the SSD or SATA disk
- with both disks active, writes were completing at the speed of the
SATA disk, which was 2-5 times slower depending on the size of the
file.

My only guess is that by specifying fdatasync on the dd command, that
forces the data to be written out to all members of the array.  Not
quite intuitive if that is by design - because otherwise, when are you
able to take advantage of the write-behind feature.

The system I was testing on was running off a Fedora 10 live CD, so
it's not the most recent software, but it's not that old, either:
(kernel 2.6.27.5-117.fc10, mdadm 2.6.7.1).

Can anyone confirm that write-behind is working for them, and a quick
test to show that it's working?

-Dave

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-03-27  5:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-26  0:39 RAID1 write-behind not working? David Rees
     [not found] ` <49CB7CB2.1020105@tmr.com>
2009-03-26 17:28   ` David Rees
2009-03-27  4:25     ` Neil Brown
2009-03-27  4:29 ` Neil Brown
2009-03-27  5:48   ` David Rees

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox