Periodically, as with any large online service, we evaluate the current load on our hardware, and make attempts at "right-sizing" so that we're not paying for severely underutilized hardware.

How concerned should I be when factoring cache memory in use? It's my understanding that cache is by and large used as an optimization, but I seem to recall also reading that cache could stay held for a while beyond needing to be used -- a sort of waste due to excessively available resources. Here's an example of one of our current systems:


So my question then is, how "safe" should I play it when considering how much load this host can (or should) hold? Do I consider everything, used/buffers/cache, as 100% required for optimal use? Or can I be more lenient with cache, and assume the system may swap out cache entries more frequently, but not to a point that would actually cause application performance issues?

  • Generally when the system runs long enough the amount of RAM used to cache file system reads (yellow bar in htop) will expand to fill all the available memory. It's by design that it doesn't get purged until the memory is really needed for something else. Therefor you can't really count this as used memory IMHO.
    – s1lv3r
    Jan 12, 2017 at 17:05
  • 1
    It really would be more useful if you showed us the output of free -m, copy and paste the terminal output into your questions. The graphics are hard to read.
    – user9517
    Jan 12, 2017 at 17:21

1 Answer 1


Caching is all about reducing access to the underlying storage (HDD or SSD), so it all depends on your I/O workload. Decreasing the available cache can increase your iowait and disk's %utils stats, meaning that the physical disk can be under increased stress.

I suggest you to decrease your available memory in relatively small steps (ie: 4 GB at times) and check if your server performance decreased. If not, you can reduce again your memory (never under your application minimal requirements, obviously).

  • 1
    +1 There's no good way to know how well a smoothly-running system would work with less RAM without deep knowledge of application specifics. In general, all you can do is figure it has enough RAM if it's working smoothly and there isn't excessive I/O and you can reduce the RAM and see if it still works smoothly to see if it can get by with less. Jan 12, 2017 at 17:28

You must log in to answer this question.

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