Comment on Why is my home server using so much RAM for cache + buffer?
Shimitar@downonthestreet.eu 6 days ago
That is expected and a good thing.
Free ram is wasted ram, so every file touched by any service will be cached and cache will stay there until ram is needed. This means that over time cache and buffers will always grow, because any subsequent access to those will be faster. The moment more ram is needed by programs, those buffers and cache will be freed immediately.
This is also the reason why some swap will be used even if there is free ram. Some stuff and pages can be swapped out without impact on performance.
Look at it this way: free ram is a wasted opportunity to increase performance by caching some file from disk.
brucethemoose@lemmy.world 6 days ago
It’s “free ram” until stuff actually goes in swap.
It depends on the scenario, of course. Maybe you have huge, totally idle processes, and active ones working from an HDD that need cache desperately, in which case this is good.
But my experience with Linux is that is waaay to aggressive with this, in most configs, and I get far better performance from configs that avoid swap until it absolutely has to be used.
Every use case is different and there is when you can customize it being Linux.
So good, sladapt your swappines and/or ditch swap completely or try zram, according to your needs. Standard use case works fine for most people tough.