Bug #58284 Agent Memory Usage Excessive advisor rule calculation is different than message
Submitted: 18 Nov 2010 11:38 Modified: 19 May 2011 21:26
Reporter: Leandro Morgado Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Enterprise Monitor: Advisors/Rules Severity:S3 (Non-critical)
Version:2.2 and above OS:Any
Assigned to: Andy Bang CPU Architecture:Any

[18 Nov 2010 11:38] Leandro Morgado
Description:
The current Agent Memory Usage Excessive advisor calculates it's memory usage as follows:

((%lua_mem_used% + %agent_mem_used%) / 1024 / 1024) > THRESHOLD

However, the message displayed when the THRESHOLD is hit states:

The agent is currently using %agent_mem_used% of memory out of a total of %ram_total% of memory on that machine.

So it's possible to hit the THRESHOLD, have the event fire and when looking at the critical warning message, think that we have not yet hit the THRESHOLD. 

How to repeat:
Example of default values:

Critical Alert = 200
Warning Alert = 100
Info Alert = 50

If %lua_mem_used% = 60Mb and %agent_mem_used% = 150Mb, then the rule below will fire:

((%lua_mem_used% + %agent_mem_used%) / 1024 / 1024) > THRESHOLD

However, the user will be confused as he only expects it to fire at 200Mb but get the message:

"The agent is currently using 150 Mb of memory out of a total of %ram_total% of memory on that machine."

Suggested fix:
Display both %lua_mem_used% and %agent_mem_used% in the event message. Perhaps something like:

"The agent is currently using (%lua_mem_used% + %agent_mem_used%) Mb of memory out of a total of %ram_total% of memory on that machine, of which %lua_mem_used% is being used for Lua/QUAN and %agent_mem_used% is used for the agent process"
[19 May 2011 21:26] John Russell
Added to 2.3.4 changelog:

The Agent Memory Usage Excessive advisor reported a value for memory
used that was too low. Now the reported value includes the memory
used by the Lua scripting language within the Agent.