Ubuntu – Linux software RAID that uses system RAM for write cache

mdmdadmraidsoftware-raidUbuntu

Is it possible to configure software RAID 5 on linux that uses system RAM for write cache? I have a file server with 8GB of RAM … would be really cool if I could dedicate 4GB to write cache. If so, how is this done? Thanks.

Best Answer

That's kinda awkward due to read-write cache is always there in despite of having RAID or a single disk block device. But there's one knob which can add more RAM for RAID's own stripe-cache: /sys/block/mdYOUR_MD_NUMBER/md/stripe_cache_size

stripe_cache_size (currently raid5 only) number of entries in the stripe cache. This is writable, but there are upper and lower limits (32768, 16). Default is 128.

This knob is addressed to lower "partial write" performance issue, AFAIS. It's meaning is number of cache pages (4k) per every disk drive in RAID.