RAID and cache memory
I recently became aware of an interesting fact about RAID controllers - specifically the ones that come with the option for battery backup units.
This probably comes as no shock to the reader familiar with high end RAID components, but it was to me. Anyway, it turns out that without a battery backup unit on your card, your card’s cache memory is generally on the “write-through” setting, and your performance goes in the toilet.
In write-through mode, whenever your OS wants to write some data out to disk, it gathers the data, submits it to the card, and waits for the operation to be reported as done. The RAID card, meanwhile, has to submit the request to disk immediately, and get the status of the operation from the disk before telling the OS the result. In write-back, by contrast, the RAID card can immediately signal to the OS that the command is complete, and it can return to the application. The result is a substantial performance increase, since the cache is actually being used (in write-through, the cache is nearly pointless from a writing perspective).
Some cards let you use write-back mode without a battery, but this is extremely inadvisable. If you do this, you stand to lose all the data in the RAID cache if someone trips over a power cord in your datacenter. I imagine 64-256M of data otherwise written to disk would be rather inconvenient to lose.
The moral of the story is this: don’t buy a LSI MegaRAID SATA-4 if you’re looking for a good, inexpensive RAID controller. Instead get the SATA-6 (or the other fancier ones), which takes a battery backup.
Tell your friends. Don’t buy a RAID controller without a battery backup! (Original reference here.)