
September 20, 2007
Sean "Obsidian" Potter
Colin "Rhettigan" Dean
ObsidianProfile
Forums
1 2 3 4
This site will look much better in a browser that supports web standards, but it is accessible to any browser or Internet device.

Looking a little closer at the mdadm command, we think the options we specified are fairly self explanatory. --create specifies what node in the /dev filesystem you want to create the array in; the md* series of names usually relate to raid devices. --level specifies what kind of RAID you want to create. We're not going to go into other types, just know that RAID0 usually gives the fastest results with the least amount of failure protection. --raid-devices specifies how many devices you're using (followed by the actual devices), and finally, auto auto-creates the node for you so everything is set up and re-creates if the drives are disconnected, which is quite useful for USB drives.
# mdadm --create /dev/md1 --level=0 --raid-devices=2 /dev/sda1
/dev/sdb1 --auto=yes
# mount /dev/md1 /mnt/usb
23.1MB/sec is a big improvement over the single drive performance, roughly 50%. Since data is being written on two drives at once, we're seeing faster drive speeds as a result. Next, we're going to user seeker to find the access time of the raid.
# time dd if=/dev/zero of=/mnt/disk/test bs=1024 count=4000000
4.1 GB copied, 177.541 seconds, 23.1 MB/s
This is an entire millisecond faster than the single drive, which may only seem like a small improvement, but when you consider your average 7200RPM hard drive's access time is in an excess of 12 ms or more, this seems like a bigger improvement. Unfortunately, I didn't have a chance to test the raid setup on my desktop, so I can't verify if they times are faster on my desktop. If you recall, my desktop showed a single drive having an access time of 3.79 ms, rather this machine's 6.x ms time.
Results: 177 seeks/second, 5.64 ms random access time
RAIDWe're seeing mixed results here. The cached reads are down, but we thinks that's just from the overhead of running the raid. There's nothing horribly wrong with this speed, though. On the other hand, we're seeing approximately a 50% performance gain in buffered reads! That's the kind of performance jumps we want to see! We wanted to see if we could push this any farther, but hdparm doesn't give us many options for a USB device. The one option we found that gives us a boost in performance is the read ahead. This changes the amount of data that is read in advance. The default setting is 512kb, but we bumped it up to 1024 and 2048 to see if we saw any gain.
Timing Cached Reads: 495.49MB/sec
Timing Buffered Reads: 37.44MB/sec
As you can see, we've gained almost a 100% speed increase over a single drive. This is strictly for sequential readings, but if you can squeeze extra performance out, then why not? Especially if you're using large files on the drive, you're going to appreciate faster read-ahead times, and you will see the benefits of it. This setting won't, however, effect the write speeds.
# hdparm -a1024 /dev/md0
Cached = Same
Buffered = 41.12MB/sec
# hdparm -a2048 /dev/md0
Cached = 35.65MB/sec
Buffered = 42.65MB/sec
mount -o sync /dev/md1 /mnt/usbLet's us the dd command to write a gigabyte of data to the drive.
That's a giant drop in performance. You're unlikely to come across this kind of performance unless you're utilizing all your RAM for other purposes.
1.0 GB copied, 125.706 seconds, 8.1 MB/s