I’m trying to run a new RAID through its paces by writing then reading a bunch of large files. It seems that the read-after-write is from the file cached in RAM, rather than from the RAID itself (Activity monitor reports no big data reads during the read phase). I change the files mod date between the write and read phases to fool the OS into thinking the cache must be stale, but I still don’t see a big disk read activity.
How can I ensure that I am reading back data from the disk (RAID) and not from the RAM cache?
[quote=38120:@Peter Stys]I’m trying to run a new RAID through its paces by writing then reading a bunch of large files. It seems that the read-after-write is from the file cached in RAM, rather than from the RAID itself (Activity monitor reports no big data reads during the read phase). I change the files mod date between the write and read phases to fool the OS into thinking the cache must be stale, but I still don’t see a big disk read activity.
How can I ensure that I am reading back data from the disk (RAID) and not from the RAM cache?
P.[/quote]
to force read/writes (aka IOs) to the physical spindles of a RAID controller is to overrun the cache on the controllers or have a way to turn the cache off. When your hosts “forces a write” to disk, the RAID controller intercepts it in its cache and acknowledges the write to the disk although it is still in cache. Then it writes the IO to the physical disk(s) when it has time or it is forced out of cache.
believe it or not there is several (potential) layers of caching too. the O/S caches read/writes before actually writing to the “disks”. And if you have a RAID controller that is another layer of cache. And most disks these days have a cache on the controller board to buffer the read/writes.
I deal with this all day long so I can answer any questions you have on the subject.
Forcing a read from disk kind of subverts the whole reason you want a raid with lots of cache
You should be testing various disaster modes like write / fail then bring it back up & read and is the data written safely and correctly
That’s funny, I was going to suggest something like that, but was going to recommend making it a number of large files in an array, then start reading the files from first to last. If you fill the RAID, it can’t possibly cache it all.