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)?
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.