uncache!

this is source code for a tiny program I just wrote that traverses specified directories and removes them from file system cache.

There are few use cases for it. One is for all these people who benchmark stuff and want selective OS cache purges, another is for those who run high performance databases. Remember the O_DIRECT serialization everywhere? Well, XFS does direct I/O in parallel, unless there are cached pages (and they can happen because of any random outside-of-database activity, like ‘file’ command). Once you ‘uncache’ the files, XFS will be very much parallel again \o/ \o/

6 thoughts on “uncache!”

  1. In new versions of linux, (and RHEL 4u6 and higher), you can also remove entries from the file system cache using /proc/sys/vm/drop_caches

Comments are closed.