[RndTbl] linux not caching files very long

Trevor Cordes trevor at tecnopolis.ca
Tue Nov 20 08:48:45 CST 2012


My main box has 8GB RAM.  There's usually 3GB of programs running.  The
rest usually is shown as free or going to buffers/cache.

I have a set of files I often linearly scan through and they are around
1GB.  They used to read in and stay cached for hours (I can tell
because my scan takes 3s when cached and 90s when not!).  Now they seem
to get dropped and require re-reading all the time, like if I don't use
them for a few minutes.

AFAICT my ps load has not changed and I'm not doing anything that is
requiring more cache/buffers that is pushing them out.

This seems to have started when I upgraded my kernel from 3.4 to 3.6
(Fedora 16) though I can't be sure at this point.

Does anyone know of some tunables I can try to tell the kernel to be
more likely to cache for longer?  I'd rather cache at the expense of
pushing more programs to swap (I run a zillion programs at all times
and never close them).

I have played with /proc/sys/vm/swappiness (80 has been great for me in
the past) but a) it doesn't seem to affect my problem now, and b) the
docs leave me scratching my head about how it really affects file
caching.

At this point I'm not interested in solutions that are "rethink your
scan!" as I do plan to one day database-itize and index the 1GB data
set... but not today!


More information about the Roundtable mailing list