Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

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.

share|improve this answer
    
Thanks. A negative answer is still an answer. You're probably right. –  silviot Nov 13 '12 at 8:19
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

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.