LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   mdadm raid 1 with SSD and Ramdisk: Force reading from Ramdisk only (https://www.linuxquestions.org/questions/linux-software-2/mdadm-raid-1-with-ssd-and-ramdisk-force-reading-from-ramdisk-only-4175500288/)

ratio 04-02-2014 05:26 AM

mdadm raid 1 with SSD and Ramdisk: Force reading from Ramdisk only
 
Is there any way to prevent or force reading from one device within a mdadm raid-1 array? Setting one device faulty is no option, array has to keep in sync all the time.

Background: I want to use mdadm to keep ramdisk in sync with SSD. For reading I want ramdisk to be used only. I am familiar to the fact, that linux kernel does a very intelligent load balancing, but for performance testing reasons it is important to read from ramdisk only.

Thank you!

jefro 04-02-2014 02:44 PM

I'm going to say no but someone might prove me wrong.

I know you can assign priority to raid swap but I've not seen it on software raid arrays. To be exact, I'd go to a hardware raid as the amount of overhead on the software would consume too much I'd think.

Not sure how to change data on one drive and both keep it in sync and not write to the other drive. Generally rsync or more advanced filesystems would be used to keep data secure. Btrfs or zfs might be used.

smallpond 04-02-2014 02:50 PM

When you create the raid1, give the ramdisk first, then the -W option, then the SSD. This makes the SSD "write-mostly" which means it will write to both, but reads will go the ramdisk. This is commonly used with SSD and HDD, but no reason it won't work with ramdisk.

ratio 04-03-2014 03:50 PM

@smallpond
Thank you! "--write-mostly" option is exactly what I was looking for. Yet uncertain is under which condition so-marked devices are used nevertheless. Some say that there is still an algorithm deciding about, some say that array needs to be in critical condition, like device failure. manpage says:

Quote:

"'write-mostly' [...] is valid for RAID1 only and means that the 'md' driver will avoid reading from these devices if at all possible. This can be useful if mirroring over a slow link."
@jefro
Thank you for introducing me into the world of btrfs. Is there any option (comparable to mdadm's "--write-mostly") to force/avoid reading from one device?

syg00 04-04-2014 12:10 AM

So test it - if it works in your seup well and good. If you have sysstat, sar will give you reasonable figures - else maybe try collectl, which will allow you to more process your I/O data over shorter timeframes. Iotop is a realtime tool for which processes are the top I/O users, not so much which device is being hit.
As for btrfs, looks like this has been discussed this year, but isn't in the plans.

jefro 04-04-2014 03:35 PM

I think that both btrfs and zfs have a way to set at what level to do syncs. I was trying to look up exactly your situation but didn't get a full answer. Might ask the btrfs people. I only use it as a novice still.


All times are GMT -5. The time now is 07:34 AM.