MySQL Server Table Cache Hit Percent 監視器

Microsoft.MySQLServer.ManagedServer.Unix.TableCacheHitPct.Monitor (UnitMonitor)

Knowledge Base article:

摘要

等候獲取 MyISAM 資料表鎖定的數量與已要求之鎖定數量的比例。MySQL 使用 MyISAM、MEMORY 及 MERGE 資料表的資料表層級鎖定。此監視器閾值會依據輪詢回傳給代理程式的平均值進行分析,其中 [樣本數] 參數控制平均值計算中所含的樣本數。

原因

狀況不良狀態表示資料表快取命中率過低。可能是資料表快取的儲存空間不足,無法存放開啟的資料表。此外,同時連線數過量可能會導致資料表快取儲存空間快速減少。

解決方法

若要解決資料表命中率過低的狀況,請增加 table_cache 大小以允許儲存更多資料表。

設定

預設設定

參數

預設值

警告閾值

小於 80

錯誤閾值

小於 70

樣本數

3

您可以使用上列定義的覆寫,變更所有執行個體或特定執行個體或群組的參數值。

Element properties:

TargetMicrosoft.MySQLServer.ManagedServer.Unix
Parent MonitorMicrosoft.MySQLServer.TableCachePerformanceRollup
CategoryPerformanceHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityMatchMonitorHealth
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.Oss.WSManEnumeration.LessThanThreshold.ThreeState.MonitorType
RemotableTrue
AccessibilityPublic
Alert Message
MySQL 伺服器資料表快取的命中率
MySQL 伺服器資料表快取目前的命中率 ({0}\%) 低
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.MySQLServer.ManagedServer.Unix.TableCacheHitPct.Monitor" Accessibility="Public" Target="Microsoft.MySQLServer.ManagedServer.Unix" TypeID="Oss!Microsoft.Oss.WSManEnumeration.LessThanThreshold.ThreeState.MonitorType" Enabled="onStandardMonitoring" ParentMonitorID="Microsoft.MySQLServer.TableCachePerformanceRollup">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.MySQLServer.ManagedServer.Unix.TableCacheHitPct.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Data/Context/Value$</AlertParameter1>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState HealthState="Success" MonitorTypeStateID="StatusOK" ID="OverThreshold"/>
<OperationalState HealthState="Warning" MonitorTypeStateID="StatusWarning" ID="UnderWarningThreshold"/>
<OperationalState HealthState="Error" MonitorTypeStateID="StatusError" ID="UnderErrorThreshold"/>
</OperationalStates>
<Configuration>
<Interval>300</Interval>
<TargetSystem>$Target/Host/Property[Type="Unix!Microsoft.Unix.Computer"]/NetworkName$</TargetSystem>
<Uri>http://schemas.microsoft.com/wbem/wscim/1/cim-schema/2/MySQL_ServerStatistics?__cimnamespace=root/mysql</Uri>
<WSManFilter/>
<ObjectName>MySQL Server</ObjectName>
<CounterName>Table Cache Hit Pct</CounterName>
<InstanceXPath>/DataItem/WsManData/*[local-name(.)='MySQL_ServerStatistics']/*[local-name(.)='InstanceID']</InstanceXPath>
<InstanceName>$Target/Property[Type="Microsoft.MySQLServer.Installation"]/InstanceID$</InstanceName>
<Value>$Data/WsManData/*[local-name(.)='MySQL_ServerStatistics']/*[local-name(.)='TCacheHitPct']$</Value>
<WarningThreshold>80</WarningThreshold>
<ErrorThreshold>70</ErrorThreshold>
<NumSamples>3</NumSamples>
</Configuration>
</UnitMonitor>