1

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.

  • I guess RAM does not load ENTIRE folder to make operations faster . – atenz Jul 17 '12 at 11:40
1

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.

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

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.

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

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.