How to give RAM to the filesystem cache

11,772

You won't give memory to the file system cache, because it is part of the page cache.

You may need to have enough physical RAM to make that possible (so you might need to buy more RAM).

See also LinuxAteMyRam (which explains that "free" RAM is used in the page cache for file data), and use the free(1) command (also ps(1) & top(1), or even htop(1)...). See also proc(5)

Of course, if you have big processes running (outside of Elasticsearch) you might terminate or stop them.

See also setrlimit(2).

Share:
11,772

Related videos on Youtube

Rohanil
Author by

Rohanil

I am a self-taught Backend developer. My educational background is in Electrical Engineering. I did my specialization in Signal Processing which is equivalent to Data Processing. And from there, I got interest in software development. I have been working as a software developer for the more than 6 years. I worked with Python for the first 2 years. Then I got into Golang for 2 years. I have experience using various tools and frameworks. I have worked professionally using flask, postgresql, mongodb, docker, celery, kafka, influxdb, elasticsearch, git, jenkins, php, javascript, vuejs.

Updated on September 18, 2022

Comments

  • Rohanil
    Rohanil over 1 year

    I am tuning my linux machine running Elasticsearch. It says that I should give at least half the memory of the machine running elasticsearch to the filesystem cache. But I don't know how much of it is given currently to filesystem cache. How to find it? And how to change it to half of the RAM?

  • Alessio
    Alessio about 6 years
    +1. While it's obvious to someone who already knows how linux filesystem caching works, if someone is asking about it, IMO it would be a good idea to explicitly state that Linux automatically uses free ram to cache files, and automatically releases memory from the cache when a program needs it (even if that's stated several times in the URLs you linked to). i.e. it just works and there's no manual tuning needed.