LINBIT featured image

Make the kernel start write-out earlier

Similar to the recent post about setting the vm.min_free_kbytes value there’s another sysctl that might improve the behaviour: the dirty ratio.

To cite a bit of an article:

Imagine a machine with lots of memory – say 100Gig. […]
Suppose this filesystem is being written to steadily so that the maximum amount of memory is always dirty. With the default vm.dirty_ratio of 40%, this could be 40Gig.[…]
Waiting for 40gig to flush for an atime update to complete is clearly unsatisfactory.

Now this isn’t entirely correct anymore; recent kernels do some tuning of these values, but you get the gist.

Even if you have a super-fast storage subsystem, you’ll have to process that data – and if you use DRBD for that filesystem, DRBD has to push that data through your network to the other node(s) – which will take some time, even with 10Gbit Ethernet …
Another advantage is that you will not as easily get into OOM situations.

So, the simple conclusion: for (possibly) heavily I/O loaded systems, set some sane value for the vm.dirty_background_bytes sysctl; again, see the recent post for more details.

Like? Share it with the world.

Share on facebook
Share on twitter
Share on linkedin
Share on whatsapp
Share on vk
Share on reddit
Share on email