I've had no luck searching how to setup writeback cache on a RAID10 setup using mdadm software RAID. I'm trying to set this up for a 4x256Gb Samsung 830 SSD setup which only has 400Mb/s write speed... CentOS6
Asked
Active
Viewed 1,098 times
1 Answers
3
If you are using those 4 to cache for a large rotational disk (or other slow disk), look into dm-cache, bcache, and friends. They're not built into mdadm but can be used on top of raid devices.
If you're only able to write 400MB/sec to those four SSDs, you should check what the bottleneck is; I doubt it's io speed, unless you're using a crappy controller. Check your iowait%, if that is high, try moving one or more of the disks to a different controller (like a PCIe sata adapter). If it is low and the cpu usage is 100%, your raid might be CPU-bound.
Most common filesystems will automatically detect optimal tuning parameters of linux softraid when you create them on md devices.

Andrew Domaszek
- 5,163
- 1
- 15
- 27
-
The server is completely empty and fresh. CPU is all idle. I'm not trying to cache for rotational disks, but is there a way to setup writeback cache for software RAID? – user3180 Sep 20 '13 at 17:17
-
Short answer is yes, but I highly doubt that is what you want in your setup. Could you edit your question to say what your end goal is (more write speed or tiered storage or something?). It might be easier to answer your question if I knew why you wanted writeback (aka write-behind) cache. – Andrew Domaszek Sep 20 '13 at 17:22
-
I have done so. I also found ' tune2fs -E stride=n,stripe-width=m /dev/mdx' recommended. But how do I determine the optimal stride value and stripe-width value? – user3180 Sep 20 '13 at 17:27
-
This is a different question entirely, but for software raid, mkfs.ext4 will automatically detect the optimal values. – Andrew Domaszek Sep 20 '13 at 17:37
-
Could you elaborate on how to setup software writeback cache and why it's a bad idea? – user3180 Sep 20 '13 at 20:04
-
Also, I believe my filesystem has already been created. I can't mkfs.ext4. – user3180 Sep 20 '13 at 20:12