Linux – slow media – disk cache tuning

encryptionlinuxperformancestorage

Is there any way to make the system more consistent when using LUKS? (or slow storage in general) as it is everything is snappy until the write buffer is full, then everything grinds to a halt as the kernel blocks writes. Same issue on my laptop with the slow SSD – its fine, then I have to wait for 30 seconds while it flushes, meanwhile I can do nearly nothing. I'm hoping to tune the disk cache system? Alternatively, if I can get things to not completely cease while blocked, instead only blocking the write that's actually being blocked?

Best Answer

There are a couple options. You can use ionice to set priorities for certain things. You can also try a different elevator, deadline would probably make more sense in your case:

http://www.redhat.com/magazine/008jun05/features/schedulers/

http://wlug.org.nz/LinuxIoScheduler