Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
I ran into similar issues, turns out my hdd has bad blocks – warl0ck Sep 11 '12 at 7:05

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:



share|improve this answer


echo 100 > /proc/sys/vm/dirty_ratio

This should postpone the blocking until all your free memory is used for write cache.

share|improve this answer
I wouldn't set it to 100 - this will eat into your buffer cache for caching blocks read from disk, making the system even slower if memory is full of dirty blocks and every read means a trip to the disk (which is already busy trying to write dirty pages). Also, you don't want to fill all available memory making it necessary to swap some pages to disk if an application needs more RAM, adding to the I/O load. The default is 10, but used to be 40 - try 40. There's generally diminishing returns - 80 won't usually be twice as good as 40. – Johnny Apr 10 '13 at 21:44



to your kernel line in /boot/grub/grub.conf.

share|improve this answer
A short explanation of what that does and how that could help here would be nice. – Mat Jan 2 '14 at 18:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.