CPU 使用量 (\%)

Microsoft.SQLServer.Windows.Monitor.DBEngine.CPUUtilization (UnitMonitor)

MSSQL 資料庫引擎的 CPU 使用率 (百分比)。

Knowledge Base article:

摘要

此監視器提供處理器實際用於處理 SQL Server 處理序執行緒之時間的測量。請注意,監視器的執行間隔不可小於 60 秒,亦不可以 60 整除,否則傳回的資料會不精確。

原因

所有配置的 CPU 都忙於處理 SQL Server 工作。

解決方式

使用效能監視器 SQL Server 計數器以及效能相關的 DMV (例如 sys.dm_exec_query_stats) 來評估 SQL Server 使用較高 CPU 百分比的原因。

對 SQL Server 中的效能問題進行疑難排解

http://go.microsoft.com/fwlink/?LinkId=789165

建立擴充事件工作階段

https://msdn.microsoft.com/zh-tw/library/hh213147.aspx

可覆寫的參數

名稱

描述

預設值

警示優先順序

定義警示優先順序。

標準

警示嚴重性

定義警示嚴重性。

錯誤

已啟用

啟用或停用該工作流程。

產生警示

定義工作流程是否要產生警示。

間隔 (秒)

每次重複執行工作流程之間的時間間隔 (秒)。

300

範例數

指出測出的值要違反多少次臨界值,狀態才會變更。

6

同步處理時間

同步處理時間使用 24 小時制。可予省略。

 

閾值

收集的值會與此參數相比。

90

逾時 (秒)

指定工作流程失敗多少次後關閉並標示為失敗。

200

資料庫連線的逾時 (秒)

若工作流程無法在指定的期限之內存取資料庫,將會失敗並登錄一則事件。

15

Element properties:

TargetMicrosoft.SQLServer.Windows.DBEngine
Parent MonitorSystem.Health.PerformanceState
CategoryPerformanceHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.Windows.MonitorType.DBEngine.CPUUtilization
RemotableTrue
AccessibilityPublic
Alert Message
Windows 上的 MSSQL: CPU 使用率 (百分比) 太高
電腦 "{1}" 上 SQL 執行個體 "{0}" 的 CPU 使用率太高。如需詳細資料,請參閱 [警示內容] 索引標籤。
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.Windows.Monitor.DBEngine.CPUUtilization" Accessibility="Public" Enabled="true" Target="SqlDiscW!Microsoft.SQLServer.Windows.DBEngine" ParentMonitorID="Health!System.Health.PerformanceState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.Windows.MonitorType.DBEngine.CPUUtilization" ConfirmDelivery="false">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.Windows.Monitor.DBEngine.CPUUtilization.AlertMessage">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</AlertParameter1>
<AlertParameter2>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</AlertParameter2>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Normal" MonitorTypeStateID="Normal" HealthState="Success"/>
<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"/>
</OperationalStates>
<Configuration>
<MachineName>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</MachineName>
<InstanceName>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</InstanceName>
<ConnectionString>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/ConnectionString$</ConnectionString>
<MonitoringType>$Target/Property[Type="SqlDiscW!Microsoft.SQLServer.Windows.DBEngine"]/MonitoringType$</MonitoringType>
<Threshold>90</Threshold>
<NumSamples>6</NumSamples>
<SqlTimeoutSeconds>15</SqlTimeoutSeconds>
<TimeoutSeconds>200</TimeoutSeconds>
<IntervalSeconds>300</IntervalSeconds>
<SyncTime/>
</Configuration>
</UnitMonitor>