This question is a rephrasing of Optimizing EXT4 performance.

I have a directory that contains build files, most very small, but totaling 5.6G.

I usually access the same subset of files (some thousands, for some tens of megabytes) over and over again. The subset changes daily (different projects, different versions of libraries). What takes longer when I use it seem to be disk seeks. For example if I do a du twice the second time it takes as much time as the first, and disk activity is similar.

Ideally I'd like to tell the kernel to allocate X Mb to the metadata and Y to data in the folder, like the options for nfs cache.

Is it possible in some way, other than mounting nfs from localhost and caching it to a ramdisk?


I think that is a question that has no positive answer. Linux does not provide any mechanism to specify how much metadata and data to cache on a per directory basis for file systems like ext2,ext3,ext4,xfs etc.

  • Thanks. A negative answer is still an answer. You're probably right. – silviot Nov 13 '12 at 8:19

I believe what you want is to do a full readahead() and/or posix_fadvise() on the data you know will be needed on the next day.

If you don't know or the resulting data is too large to be cached, then you already know the answer. The kernel doesn't cache it all because there's not enough memory for that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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