1

The more time the server run, the more buff/cache Mysql processes use, i'm at 95% right now and only a server reboot free the buff/cache memory. None of the mysql commands free it on the go.

Is it a normal behavior? What if my others processes need memory and Mysql use all the remaining with the buff/cache ? Will it unclaim it automatically or the server will just probably crash...?

top

htop

Owow
  • 123
  • 4
  • 2
    This is normal. Only allocate it the amount of memory you are happy for it to use permanently. – tater Nov 26 '20 at 18:46
  • 1
    What are the 4 processes at the end of the list ? Additional information request. Any SSD or NVME devices on MySQL Host server? Post on pastebin.com and share the links. From your SSH login root, Text results of: B) SHOW GLOBAL STATUS; after minimum 24 hours UPTIME C) SHOW GLOBAL VARIABLES; D) SHOW FULL PROCESSLIST; AND Optional helpful information, if available includes - htop OR top for most active apps, ulimit -a for a Linux/Unix list of limits, iostat -xm 5 3 for IOPS by device and core/cpu count, for server workload tuning analysis to provide suggestions. – Wilson Hauck Nov 26 '20 at 22:49
  • https://www.linuxatemyram.com/ – AKHolland Dec 02 '20 at 19:10
  • @Owow Any chance you can post additional information requested Nov 26 at 22:49? – Wilson Hauck Dec 11 '20 at 01:17

2 Answers2

2

That's OS caching, not MySQL.

In general, a "cache" is designed to release the space when someone needs it. So having lots of space consumed by a cache is not the same as "running out of RAM".

Specifically, MySQL seems to be using a meager 1GB of the 8GB. See Wilson's requests for more on what we can point at to say that you are not in trouble.

Rick James
  • 2,058
  • 5
  • 11
1

Your htop screenshot is very difficult to read. Unfortunately, capturing text does not help as the colors are significant. See also: What exactly do the colors in htop status bars mean? For the benefit of the less-sighted: the Mem line is 12 lines of green used, 1 of blue buffers, and 70 of yellow/orange cache. 950M used of 7.6GB. No swap.

This use of all available RAM for caches is normal. DRAM is much faster than permanent storage, which provides a performance boost. Memory will be reclaimed on demand, from caches first.

Observe it yourself. Run something that would use some memory, like applying software updates. Watch it not crash. See if reclaim has a noticeable impact on performance.

John Mahowald
  • 30,009
  • 1
  • 17
  • 32