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.

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

2 Answers 2

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.

1
  • The question was about telling the kernel to prefer caching for a particular folder.
    – silviot
    Nov 10, 2012 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.

1
  • 1
    Since kernel 2.6.30 or so Linux uses the less-intensive relatime option instead of atime by default.
    – ish
    Jul 17, 2012 at 17:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .