What would happen if I did a raid on a SSD and an HDD?

I am building another server (cheap) and would like to go with a 256GB SSD drive for my boot and data. This will be enough for my needs, but just having one SSD scares me for a couple of reasons.

If I did a mirror raid with a SSD and an HDD, what would happen?

How much would it slow down the raid on read? Would it read from the faster source?

How much would it slow down the write? Would it wait until writes were sent to both the SSD and the HDD?

Does anybody see an advantage in doing this?

I found this question, but I think it is slightly different: SSD redundancy via HDD


Solution 1:

A self-speaking excerpt from man mdadm:

   -W, --write-mostly
          subsequent  devices  listed in a --build, --create, or --add command will be flagged as 'write-mostly'.  This is valid for RAID1
          only and means that the 'md' driver will avoid reading from these devices if at all possible.  This can be useful  if  mirroring
          over a slow link.

Solution 2:

This would be a poor idea overall. Vendor implementations of RAID vary, of course, so you will get different behavior with different vendors. Most assume that drives are significantly identical, so aren't designed to handle disks of such different performance characteristics. Chances are very good your performance will be handicapped by the slower disk.

For mirrored RAID writes, this is especially the case since many vendors don't consider a write Committed until it's on both disks, which will limit your write performance to the speed of the slower drive. For vendors that use a "commit when one is written to" you're going to be limited by the size of the write-cache of the RAID device, as that's going to end up buffering all the writes the slower drive can't commit to.

For mirrored RAID reads, you will still be limited by the speed of the slower drive in many cases as RAID vendors can do a couple of things:

  • Pick One To Read From. If it picks the slow drive, all reads will be slow.
  • Round Robin. Again, reads will be handicapped by the slow drive.
  • Read-combining optimization, alternating. Once again, reads will be handicapped by the slow drive.
  • Read from the drive with the smallest write-queue. This is the only method where the SSD would help.

Parity-RAID has much the same problems.