Disabling read-cache buffering for a device
Hey all,
I'd like to disable the buffer/read cache when Linux reads from a file and stores it in temporary RAM, so if read again, it can be from RAM instead of disk. But I want to do it on just one storage device (say /dev/sdb).
I'm NOT looking to benchmark the specific storage device. What I'm looking for is to disable read buffering for it, because it is a SSD and I prefer my RAM to be used by cache from the slower hard disk instead of caching SSD.
Linux is not booted from the SSD anyway, since logging would kill it too fast for my use and I need all of its small space for the specialized applications I'm using (where I read from it 99% of the time and barely write).
Anyway my simple question is, can I tell linux to not cache the SSD, or at least prioritize one device for caching over another? If I run out of memory for caching, I'd like it to not discard my hard-disk's cached data, because re-reading data from SSD is much much faster than from HDD so I'd rather have it re-read from the SSD always.
i.e it could cache /dev/sdb but never replacing old cache from /dev/sda, since /dev/sda is priority etc.
Last edited by kktsuri; 05-13-2015 at 09:38 AM.
|