Dec 292005

What RAID-1 setup should I use for FreeBSD 6.0?

This article will highlight the disk drive tests I ran on my ASUS A8V Deluxe. I’m about to set this machine up to do various things, including cross compiling (which I wrote about back in October). I still haven’t finished what I wanted to do, which is set up this machine with RAID-1 running FreeBSD 6.0. When I started, 6.0 had not yet been released. Now I’m about to redo some of my work and expand the scope slightly. Here is what I plan to do. I have some SATA and some IDE drives that I’m going to test on various configurations to see what setup gives me the fastest results. I don’t expect the differences to be huge. This isn’t scientific. I’m just using the hardware I have. I will be testing the various configurations shown in the table below:  on board3Ware 7006-2gmirrorSATA
The columns represent the type of RAID-1 I will be using. The mainboard offers both SATA and IDE RAID-1. The 3Ware 7006-2 does only IDE, not SATA. I will also be testing gmirror(8). For the gmirror part, I will be using Dru’s recent article: Using Software RAID-1 with FreeBSD. And for kicks and giggles, I’ll also try just a plain old SATA and plain old IDE (i.e. no RAID-1). All testing was done on the same machine. For each test I installed 6.0-RELEASE, did a cvsup of both the ports and source tree. Then I did a build world and upgraded to 6.0-STABLE. Each cvsup was against the same image of the repository (i.e. my local cvsup server, which I did not update during the course of this testing) to ensure each system was running against the same STABLE. With the system running on 6.0-STABLE, I then installed PostgreSQL 8.1 (along with some other packages), and ran a simple test:
time psql < freshports.sql
I am interested only in the elapsed time. I don't care about anything else. I want throughput. And I want it fast. I could have used a snapshot. I didn't. I could have used some other test. I didn't. I used what I had and did a test that is both disk intensive and CPU intensive. FYI: the FreshPorts database I'm using is the daily backup taken at 29 Dec 2005 at 03:41. The file is about 526MB. At the time of the test, these packages were installed:
$ pkg_info
bash-3.0.16_1             The GNU Project's Bourne Again SHell
bison-1.75_2,1            A parser generator from FSF, (mostly) compatible with Yacc
cvsup-without-gui-16.1h_2 General network file distribution system optimized for CVS
gettext-0.14.5            GNU gettext package
gmake-3.80_2              GNU version of 'make' utility
joe-2.8_5                 Joe's own editor
libiconv-1.9.2_1          A character set conversion library
m4-1.4.4                  GNU m4
postgresql-client-8.1.1   PostgreSQL database (client)
postgresql-contrib-8.1.1  The contrib utilities from the PostgreSQL distribution
postgresql-server-8.1.1_1 The most advanced open-source database available anywhere

Special thanks to my local computer store

I want to mention a local computer store, which I only just discovered. Over the Top Computing is only about 3km from my house, less if I cycle there. I dropped by there a few days before Christmas to buy a USB cable, and would up getting an external SATA HDD enclosure and the HDD to go into it. Not to mention a laptop drive/IDE convertor (just in case). I happened to ask them if they knew where I could get a couple of drive trays for an Antec Sonata case. They did. They had some in the back. And the special screws to go with them. BONUS! Why is this relevant to this article? I'm using those trays now. It's much easier to swap drives around than traditional drive mounts. Drive rails would be nice, but they don't have the sound dampening provided by those rubber o-rings that you can see. The drive and screws touch only the rubber, not the tray. That reduces vibration and noise. Nice feature.

OK, so where are the results?

I have only partial results. I plan to post at least one set of results per day over the next 6 days. Watch this space.

 on board3Ware 7006-2gmirrorSATA
7m 58.169s1
n/a- IDE9m49.503s
9m 46s2
9m 5.25663,4
11m 40.99s3
1 The two SATA drives used for the above were:
  • Maxtor DiamondMax Plus 9 120GB SATA 7200 RPM 8MB Cache (details)
  • Western Digital WD1200JS 120GB SATA 7200 RPM 8MB Cache (details)
2 The two IDE drives used for the above were:
  • Seagate Barracuda - Model ST380011A 80 GB ATA 100 (details)
  • Maxtor DiamondMax Plus 9 80 GB ATA/133 (details)
The above is not a good match; one was ATA/100, the other ATA/133. I'll redo that test with two identical Maxtors. 3 The two IDE drives used for the above were:
  • Maxtor DiamondMax Plus 9 80 GB ATA/133 (details)
  • Maxtor DiamondMax Plus 9 80 GB ATA/133 (details)
4 The original tests were mistakenly done against 6.0-RELEASE. The following result are against 6.0-STABLE:
  • 10m19.299s
  • 10m48.184s
  • 10m44.767s
  • 10m49.755s
  • 10m46.567s
  • average: 10m 41.71s

The times shown in a particular column represent each test run. The last number in a particular cell of the table is the average of the numbers above it. So far, SATA onboard rules. But to be fair, each SATA drive has its own cable. The single IDE cable is shared by two drives (that is the only setup for IDE RAID on this main board). The last update occurred at: October 10 2012 13:28:01. I just thought of something else I could try: compare i386 against amd64. I may do that if I have time.

  2 Responses to “What RAID-1 setup should I use for FreeBSD 6.0?”

  1. I noticed that with one test you used identical drives, but with other tests you used different models and even brands of drives. i’ve read information on hackers@ and other sources in the past stating that when setting up a raid environment, you should try to use the same type of drives. Using drives with different performance characteristics can cause one drive to be "faster" most of the time and defeat the purpose. If you think about it, raid 1 must write data to both disks and can read from either one. Each vendor has different cache and write timings, etc.

    That being said, I have a raid 1 setup using gmirror. At the time i setup the box, it was running 5.4 with a patched ata driver to support my sata controller. The onboard raid was not supported. I upgraded the machine to 6.0 release and noticed a large improvement in gmirror. The drives are identical SATA western digital 80gb drives with 8mb cache. (same model, etc) Performance since I upgraded to 6.0 release has been excellent. The array often beats my single ultra 160 seagate 6mb cache 72gb 10k drive.

    • I use two disks from different manufacturers to improve the reliability of the RAID array. If there is a defect in the drive, and both drives are different brands, you’re much less likely to have a double failure in a short period of time (i.e. you lose both drives).

      The Man Behind The Curtain