Bug #86845 MEM 3.3 RAM Usage adviser calculating wrong memory usage for RHEL 7.2 OS
Submitted: 28 Jun 2017 7:13 Modified: 28 Jun 2017 8:39
Reporter: lalit Choudhary Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Enterprise Monitor: Advisors/Rules Severity:S3 (Non-critical)
Version:3.3.2 OS:Linux (RHEL 7.2)
Assigned to: CPU Architecture:Any
Tags: mem, ram usage adviser

[28 Jun 2017 7:13] lalit Choudhary
Description:
free, top and /proc/meminfo commands outputs are changed from  RHEL 7.1 onwards, but the MySQL Enterprise Monitor RAM Usage calculation formula is same which send a false alert on the basis of only free field value in free, top, /proc/meminfo commands.

RHEL 7 has an additional field called MemAvailable in /proc/meminfo
RHEL 7 has a slightly changed output of the free command, it has an additional field called Available.

Since  MySQL Enterprise Monitor RAM Usage  Adviser compares the threshold with only free value and not considering available memory resulting into false RAM usage alerts.

We are using RHEL 7 and  MySQL Enterprise Monitor 3.3 with MYSQL 5.7  

---------------------
Ref Link: https://access.redhat.com/solutions/406773

In RHEL 7
Raw
                    total       used       free     shared    buffers     cached
Mem:          3688       3548        139        182          0       3040
-/+ buffers/cache:        508       3179
Swap:         3983          6       3977

In RHEL 7.1 the output is below
Raw
                       total        used        free      shared  buff/cache   available
Mem:         257751        1842      254508         105        1400      255327
Swap:          4095           0        4095

How to repeat:
free, top and /proc/meminfo commands outputs are changed from  RHEL 7.1 onwards, but the MySQL Enterprise Monitor RAM Usage calculation formula is same which send a false alert on the basis of only free field value in free, top, /proc/meminfo commands.

RHEL 7 has an additional field called MemAvailable in /proc/meminfo
RHEL 7 has a slightly changed output of the free command, it has an additional field called Available.

Since  MySQL Enterprise Monitor RAM Usage  Adviser compares the threshold with only free value and not considering available memory resulting into false RAM usage alerts.

Suggested fix:
Fix ram_unused calculation according to the new  free, top and /proc/meminfo commands outputs are changes from RHEL 7.1 on-words.
[28 Jun 2017 8:39] MySQL Verification Team
Thank you for the report and feedback.
Verifying based on my internal discussion with Mark.