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?


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).

  • 7
    +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. – cas Feb 20 '18 at 2:44

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.