クエリ キャッシュの使用割合。クエリ キャッシュには、select ステートメントの内容とそれに対応する結果が格納されます。これらの結果は、insert、update、delete ステートメントの後で無効になります。クエリ キャッシュのサイズは、グローバル変数 query_cache_size を使用して制御します。クエリ キャッシュに挿入できるクエリのサイズは、グローバル変数 query_cache_limit で制御します。このモニターしきい値は、エージェントへのポーリングで返された値の平均値を基準として分析されます。ここで [サンプル数] パラメーターは、平均値の計算に使用されるサンプルの数を制御します。
MySQL クエリ キャッシュの使用割合が高くなっていることを、異常な状態が示しています。最近使用されたクエリを格納するのに十分な記憶域がクエリ キャッシュにない可能性があります。個々のクエリに対してクエリ キャッシュの制限が高すぎるので、格納されるクエリの数が少なくなり、使用割合が高くなっている可能性があります。
クエリ キャッシュの使用割合が高い問題に対処するには、query_cache_size の値を大きくして、追加のクエリを格納できるようにします。query_cache_limit の値を小さくすると、クエリ キャッシュ内に追加のクエリを格納できるようになります。
既定の構成
パラメーター | 既定値 |
警告しきい値 | 85 より大きい |
エラーしきい値 | 95 より大きい |
サンプル数 | 3 |
上記で定義されたパラメーター値は、上書きにより、すべてのインスタンスまたは特定のインスタンスやグループに対して変更できます。
Target | Microsoft.MySQLServer.ManagedServer.Unix | ||
Parent Monitor | Microsoft.MySQLServer.QueryCachePerformanceRollup | ||
Category | PerformanceHealth | ||
Enabled | True | ||
Alert Generate | True | ||
Alert Severity | MatchMonitorHealth | ||
Alert Priority | Normal | ||
Alert Auto Resolve | True | ||
Monitor Type | Microsoft.Oss.WSManEnumeration.GreaterThanThreshold.ThreeState.MonitorType | ||
Remotable | True | ||
Accessibility | Public | ||
Alert Message |
| ||
RunAs | Default |
<UnitMonitor ID="Microsoft.MySQLServer.ManagedServer.Unix.QueryCacheUsePct.Monitor" Accessibility="Public" Target="Microsoft.MySQLServer.ManagedServer.Unix" TypeID="Oss!Microsoft.Oss.WSManEnumeration.GreaterThanThreshold.ThreeState.MonitorType" Enabled="onStandardMonitoring" ParentMonitorID="Microsoft.MySQLServer.QueryCachePerformanceRollup">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.MySQLServer.ManagedServer.Unix.QueryCacheUsePct.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="UnderThreshold"/>
<OperationalState HealthState="Warning" MonitorTypeStateID="StatusWarning" ID="OverWarningThreshold"/>
<OperationalState HealthState="Error" MonitorTypeStateID="StatusError" ID="OverErrorThreshold"/>
</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>Query Cache Use 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(.)='QCacheUsePct']$</Value>
<WarningThreshold>85</WarningThreshold>
<ErrorThreshold>95</ErrorThreshold>
<NumSamples>3</NumSamples>
</Configuration>
</UnitMonitor>