MySQL Server > 90% memory consumption

memoryMySQL

I have a fairly large (16 vCPU / 47 GB of RAM) linode box which hosts a running MySQL Server. This box currently does nothing else (and we are not planning to install anything else on it for now).

The server is monitored by New Relic. Our warning policy places the server in RED (=danger) state when either : CPU > 80% or Memory > 90% or Disk IO > 90% or Disk Full > 90%.

The DB is fairly large (lots of data!) but low access rate (< 1 request per second). We are basically collecting lots of data, and we will do something out of it "someday". I am not complaining about the DB perfs. The CPU usage is flat around 1 or 2 %. No issue there either.

Should I still be worried about the memory warning or should I modify the server warning policy to "untrack" memory usage ? Or should I simply force mysql to use less memory (via a config somewhere).

Is there any relevant measure you think I should keep an eye on. As you guessed I have little to none dev ops / admin experience.

Best Answer

Well, having 10% free of big RAM is still a lot of space, but MySQL memory usage should be fairly predictable. You can check your config with http://www.mysqlcalculator.com/ or similar tool.

You don't want it to get to swap or OOM if swap is disabled, so tune it to use less than total RAM, maybe keep it under 90% for mysql and normal system usage. Then if it gets over 90, you actually know something is off (maybe some OS service memleak or similar stuff), but you still have few GB to delay real trouble.