1

Say I have two hard drives that max at 200 MBytes/sec writes per hard drive. Now let's say both drives are in a USB enclosure that maxes at 300 MBytes/sec writes for the entire enclosure.

When setting up software RAID-1 (mirroring) of both drives using mdadm on Linux, would it improve write performance by putting each of the two drives into different USB enclosures?

Another way to ask this question, does mdadm software RAID-1 double the write bandwidth needed to USB enclosure(s)?

Crash Override
  • 601
  • 1
  • 10
  • 21
  • Even also without raid, you would do that to have a faster Interaction with your disks :-) Its like, if you have a dicision to take, a Big Pipe for all multiple or multiple for pipe for each direction and user seperate - what "sounds" faster? – djdomi Jun 02 '21 at 04:13

1 Answers1

4

Software RAID talks to each drive independently. So, basically, you're right, if you put them into single enclosure with 300 MB/s peak, you'll end up that bandwidth spread to drives and they could have each no more than 150 MB/s each.

However, there are other caveats. For instance, USB. It adds some latency to bulk transfers (which storage is doing) and some overhead. Theoretical USB 3.2 bandwidth is 5Gbit/s which is 500 MB/s (taking 10b/8b encoding into account), but usually of around 60% of that is available as net data transfer rate. So if you connect both enclosures to the same bus, I'd expect you'll still won't saturate your drives. So learn how USB buses are laid out inside the computer. Also think which load your system will have with such setup, I expect CPUs will waste many cycles waiting for I/O or serving USB interrupts.

In general, USB is not about fastest performance. Rather it is about general usability and everyday-use reliability, a technology incompetent user can work with and they won't easily break everything. Connectors are designed to withstand many connect-disconnect cycles, the possibility to easily branch connections via hubs to connect very many devices; the whole stack is as automatic as it could be and so on. I could assume you have your reasons to do this, but if you're about transfer speed, better use other storage interfaces and don't waste your time optimising software RAID over USB.

Nikita Kipriyanov
  • 10,947
  • 2
  • 24
  • 45
  • Thanks for this. After thinking RAID in USB enclosures would be reliable and fast, and after reading your suggestion about USB not intended for this purpose, I decided to abandon RAID on USB. Instead, I went with with a large-capacity 2.5" SSD that fit inside my mini PC via SATA interface. The SSD was pricier than hard drives, but I get the great transfer rates without the RAID hassle. Now using the USB enclosure just for hot-pluggable backups, writing onto one hard disk at a time, as USB was intended for. – Crash Override Jun 14 '21 at 21:27