Use Azure Monitor to monitor server memory usage

Front and we talk on how to use Azure Monitor to monitor server CPU resources to ensure that in the event of CPU usage is too high, we can process it the first time, to ensure that the system can run smoothly. But know this, in addition to CPU resources, there are many indicators will affect the operation of our state system, such as we have today and we want to talk memory resources. Memory usage is too high will lead to business system is running slow, can not login, system crashes and other problems. So monitor memory usage of resources is also essential. So let's look at how to use the memory usage Azure Monitor to monitor the system.

Pre-conditions
pre-conditions to use Azure Monitor monitor system memory usage of resources we have in the previous article we talked and, specifically, we can refer to the following blog:
https://blog.51cto.com/wuyvzhang/2472792

Query data collected
we can use the following query, the query is less than 1024MB of memory remaining memory server:

let setMBValue = 1024;
let startDate = ago(12h);
// enter how many days/hours to look back on
Perf
| where TimeGenerated > startDate
| where ObjectName == "Memory" and CounterName == "Available MBytes Memory" and Computer in ((Heartbeat
| distinct Computer))
| extend FreeMemory = CounterValue
| summarize FreeMemoryMB = min(FreeMemory) by Computer
| where FreeMemoryMB < setMBValue
| summarize max(FreeMemoryMB) by Computer
| join
(
Perf
| where TimeGenerated > startDate
| where ObjectName == "Memory" and CounterName == "Available MBytes Memory" and Computer in ((Heartbeat
| distinct Computer))
| extend FreeMemory = CounterValue
)
on Computer
| make-series Free_Memory_MB = min(FreeMemory) on TimeGenerated from ago(8h) to now() step 2h by Computer
| render timechart

Use Azure Monitor to monitor server memory usage

Creating Alert
if we want to set up e-mail, SMS and other alarm rules can be created by "+ New alert rule":
Use Azure Monitor to monitor server memory usage

After created Alert, available memory when the system is less than 1024MB, we will receive an alert:
Use Azure Monitor to monitor server memory usage
Use Azure Monitor to monitor server memory usage

The performance chart is fixed to the dashboard
unity we can also check the top right of the window by clicking the "fix" button, then select the icon we want to show in the Dashboard, to display the query results to Azure Dashboard:
Use Azure Monitor to monitor server memory usage

Guess you like

Origin blog.51cto.com/wuyvzhang/2472807