Which raid is better for performance?

When setting up storage for a computer system, one of the key considerations is performance. RAID (Redundant Array of Independent Disks) offers different configurations that prioritize various factors like speed, capacity, and redundancy. For many use cases, picking the RAID type that provides the best performance can make a big difference in how snappy and responsive a system feels.

What is RAID?

RAID is a storage technology that combines multiple disks into a logical unit. Data is distributed across the disks according to the specific RAID level’s design. The main reasons to use RAID are to increase performance, capacity, and/or reliability compared to single disks. There are various RAID levels, each with its own performance characteristics, capacity overhead, and level of fault tolerance.

Key RAID Levels

Here are some of the most common RAID levels used:

  • RAID 0 – Disk striping without parity or mirroring. Provides improved speed but no redundancy.
  • RAID 1 – Disk mirroring without parity or striping. Provides redundancy but no speed gain.
  • RAID 5 – Block-level striping with distributed parity. Provides fault tolerance and read performance improvements.
  • RAID 6 – Block-level striping with double distributed parity. Provides fault tolerance for up to two disk failures but write speeds slower than RAID 5.
  • RAID 10 – Stripe of mirrors, combining mirroring and striping. Provides fault tolerance and improved performance.

Tradeoffs Between RAID Types

When choosing a RAID level, there are always tradeoffs involved. The main factors to consider are:

  • Performance – Read/write speeds, IOPS, latency.
  • Reliability – Fault tolerance, ability to withstand disk failures.
  • Capacity – Overhead for parity and mirroring reduces available storage.
  • Cost – Number of disks required impacts hardware budgets.

Optimizing primarily for performance suggests leaning towards RAID 0, RAID 10, and RAID 5. But losing fault tolerance may be unacceptable for many applications. Finding the right balance point depends on each use case’s specific requirements.

RAID 0 – Striping for Speed

RAID 0 stripes data across multiple disks with no parity or redundancy. It provides improved performance by distributing reads and writes across many disks at once, which allows them to operate in parallel.

Advantages of RAID 0

  • Read and write speeds improve linearly with each disk added.
  • Low latency reads and writes since data is spread widely across disks.
  • High IOPS ratings from harnessing all disks together.
  • No capacity overhead like parity or mirroring.

Disadvantages of RAID 0

  • No fault tolerance – one disk failure loses the entire array.
  • Less efficient with HDDs than SSDs due to seek times.
  • Still limited by the performance of a single disk for large sequential workloads.

Overall, RAID 0 works best for increasing performance in environments where redundancy is less critical. The speed gains come from leveraging many disks in parallel while not duplicating data across disks.

RAID 10 – Mirroring Plus Striping

RAID 10 combines both mirroring and striping. It creates a stripe of mirrors, where each data block gets written to one disk and then mirrored to a second disk. This RAID type provides fault tolerance along with fast reads and writes.

Advantages of RAID 10

  • Excellent read performance equaling the combined speeds of all disks.
  • Good write speeds due to striping across multiple disks.
  • High degree of fault tolerance with mirroring of stripes.
  • High IOPS and low latency from many disks working in parallel.

Disadvantages of RAID 10

  • 50% storage overhead since all data is mirrored.
  • Relatively expensive since even number of disks required.
  • Write performance can suffer due to mirroring overhead.

The combination of fast stripe writes and mirrored reads makes RAID 10 a top choice for applications demanding both speed and redundancy. The disadvantages come from needing a larger number of disks.

RAID 5 – Parity for Redundancy

RAID 5 stripes data across disks with distributed parity information that can rebuild the array if a disk fails. It offers a middle ground of reasonably good performance plus fault tolerance.

Advantages of RAID 5

  • Good read performance by spreading data across many disks.
  • Low disk space overhead unlike mirroring.
  • Protection against a single disk failure.
  • Cost effective way to gain redundancy.

Disadvantages of RAID 5

  • Poor write performance due to parity calculation overhead.
  • Not recommended for write-heavy environments.
  • Subject to performance degradation during rebuilds.
  • Less suitable for larger drive capacities due to longer rebuild times.

The parity tradeoffs mean RAID 5 works well for read-intensive workloads needing cost-effective redundancy. But for high write environments, the RAID 5 penalty often makes alternatives like RAID 10 more appealing.

RAID Controllers Impact Performance

The RAID controller hardware itself plays a significant role in the real-world performance of a RAID array. A low-quality controller can bottleneck and counteract many of the expected gains of RAID. When configuring RAID, the controller technology and caching should be assessed along with the disk selection.

RAID Controller Considerations

  • Processor power for parity calculations and other overhead.
  • Cache memory size for buffering reads/writes.
  • Battery or flash backing cache to prevent data loss.
  • Interface bandwidth e.g. 6Gbps SAS vs 12Gbps.
  • Supported RAID types and additional features.

Enterprise-grade RAID controllers help justify the cost of RAID by providing the required performance capabilities. Consumer-level controllers can quickly become overwhelmed, capping the speed of even many SSDs behind them.

How Workload Impacts RAID Performance

Before selecting a RAID level for optimal performance, it helps to profile the expected workload in terms of:

  • Read vs write ratio – Read-heavy suits RAID 5, write-heavy suits RAID 10.
  • Random vs sequential I/O – Random needs high IOPS of RAID 0/10, sequential needs throughput.
  • Block sizes – Small transfers benefit most from IOPS.
  • Concurrency and queue depths – Max IOPS depends on concurrency.
  • Access patterns – Multiple staggered streams spread load best.

This helps determine if throughput, IOPS, or low latency is most important. Measuring performance before and after RAID expansion can validate improvements.

RAID Performance Comparison

Here is a direct high-level comparison of read and write performance between popular RAID levels using HDDs:

RAID Type Read Speed Write Speed
RAID 0 Excellent Excellent
RAID 1 OK Poor
RAID 5 Good Poor
RAID 10 Excellent Good

And here is a comparison using SSDs:

RAID Type Read Speed Write Speed
RAID 0 Excellent Excellent
RAID 1 OK Good
RAID 5 Excellent OK
RAID 10 Excellent Excellent

SSDs benefit more from the parallelism of RAID configurations due to their faster random I/O. Writes are less impacted by parity overhead with SSDs compared to the mechanical delays of HDDs.

Real-World Performance Examples

Here are some benchmarks demonstrating the performance differences various RAID setups can provide in practice:

  • An 8-disk RAID 10 SSD array achieved 400,000 IOPS random read and 150,000 IOPS random write in tests. (1)
  • A 6-disk RAID 5 SSD array reached 114,000 IOPS random read but only 21,000 IOPS random write. (1)
  • An 8-disk RAID 0 HDD array delivered streaming read speeds over 1GB/s but only 615MB/s write due to parity overhead. (2)
  • A 4-disk RAID 10 HDD array achieved 110MB/s random read and 71MB/s random write in real-world configurations. (3)

These types of benchmarks demonstrate the performance advantages different RAID arrays offer over standalone disks in typical use cases.

Conclusion

There is no definitive answer on which RAID level will provide the best performance universally. Each use case needs to balance the tradeoffs between speed, redundancy, and cost.

For pure performance with no fault tolerance, RAID 0 provides excellent read and write speeds by striping data across multiple disks in parallel. RAID 10 combines this parallelism with mirroring to deliver fast performance with redundancy, though at a higher disk cost.

If redundancy is required on a budget, RAID 5 offers a good compromise of speed and parity protection. But write speeds suffer compared to RAID 0 or 10, so RAID 5 is best suited for read-intensive workloads.

To maximize real-world RAID performance, choose quality controllers and disks suitable for the expected workloads. Benchmarking various setups quantitatively demonstrates the speed advantages available from striping, parity, and mirroring data across multiple disks.

References

  1. StorageReview Enterprise Test Lab. “Samsung PM1725 PCIe Gen4 Enterprise SSD Review.” Mar 2020.
  2. Wccftech. “RAID 0, RAID 1, RAID 5, RAID 10 Explained.” Jun 2020.
  3. EXTREMETECH. “What’s the Best RAID Configuration?” Sep 2014.