0

Recently I saw that my server Ubuntu 18.04 LTS has a high usage of buff/cache memory.

free -mh
              total        used        free      shared  buff/cache   available
Mem:           7.8G        1.5G        4.4G        109M        1.9G        5.9G
Swap:          8.0G          0B        8.0G

This is after rebooting a server, before it was 5GB.

top - 09:39:07 up 18 min,  1 user,  load average: 0.09, 0.28, 0.58
Tasks: 161 total,   1 running, 104 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.3 us,  0.1 sy,  0.0 ni, 99.1 id,  0.5 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem :  8153548 total,  4574140 free,  1534508 used,  2044900 buff/cache
KiB Swap:  8388604 total,  8388604 free,        0 used.  6202180 avail Mem 

After running echo 3 > /proc/sys/vm/drop_caches to drop it, it started to go high again.

How can I detect who consume most of buff/cache and should I be worried if goes that high?

1 Answers1

1

should I be worried if goes that high?

No. On Linux, caching is at a low priority, and is automatically and easily reclaimed. https://www.linuxatemyram.com/

Actually, half of memory being free means you have twice the RAM you "need" at that workload; half is not being used. Do some capacity planning to check if this host's workload will increase. If not, you could reduce and re-purpose its memory. Say by reducing the VM's RAM allocation down to 6 or 4 GB.

After running echo 3 > /proc/sys/vm/drop_caches to drop it, it started to go high again.

Don't drop_caches, this has no operational purpose, and makes things slower. Good use cases for it are limited to cold starting benchmarks.

John Mahowald
  • 32,050
  • 2
  • 19
  • 34