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.

I'm using my machine to build stuff a lot and there's a specific directory that gets used very often. I've got 8GB of RAM, which is helpful for the build, but is far from enough to cache the whole folder (which is around 12GB).

I'm wondering. Is there a way to optimize the access to this particular folder? For instance, can the directory structure for this folder be cached in the RAM? Can the most used files be cached into the RAM as well?

Do you know of such a solution for Ubuntu? I've got UPS so I'm not particularly bothered by power downs.

share|improve this question
    
I guess RAM does not load ENTIRE folder to make operations faster . –  atenz Jul 17 '12 at 11:40

2 Answers 2

can the directory structure for this folder be cached in the RAM? Can the most used files be cached into the RAM as well?

Yes. That is how the system normally operates; you don't have to do anything special. The kernel automatically caches recently accessed files in unused ram.

share|improve this answer
    
The question was about telling the kernel to prefer caching for a particular folder. –  silviot Nov 10 '12 at 23:19

The operating system will already have a system cache for the files you access. However if you are working with lots of small files you'd probably be better off turning of atime with the noatime boot parameter.

Each time you access a file, it triggers a write to update when a file was last accessed.

Other than that or buying an SSD drive the linux kernel does its best to provide you with the fastest system it can. Having knobs to fiddle with isn't a good programming model.

share|improve this answer
1  
Since kernel 2.6.30 or so Linux uses the less-intensive relatime option instead of atime by default. –  izx Jul 17 '12 at 17:19

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.