Monitor percentage weghalingen uit cache voor query's van MySQL-server

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

Knowledge Base article:

Samenvatting

Het percentage weghalingen uit de cache voor query's. Weghalingen uit de cache voor query's vinden plaats als de cache voor query's vol is en de minst recente query daarom wordt weggehaald. De grootte van de cache voor query's wordt bepaald met de globale variabele query_cache_size. De monitordrempelwaarde wordt geanalyseerd tegen het gemiddelde van de waarden die in peilingen aan de agent worden geretourneerd. De parameter Aantal steekproeven bepaalt het aantal steekproeven dat bij de berekening van het gemiddelde is opgenomen.

Oorzaken

Een slechte status geeft aan dat het percentage weghalingen uit de cache voor query's hoog is. De cache voor query's heeft mogelijk onvoldoende opslagruimte voor recent gebruikte query's. De limiet van de cache voor query's voor afzonderlijke query's is mogelijk te hoog, waardoor meer weghalingen plaatsvinden.

Oplossingen

Als u een hoog percentage weghalingen uit de cache voor query's wilt verhelpen, verhoogt u de waarde voor query_cache_size zodat meer query's kunnen worden opgeslagen. Als u de waarde voor query_cache_limit verlaagt, kunnen meer query's de cache voor query's vullen voordat een weghaling plaatsvindt.

Configuratie

Standaardconfiguratie

Parameter

Standaardwaarde

Waarschuwingsdrempel

Groter dan 70

Drempelwaarde voor fouten

Groter dan 80

Aantal steekproeven

3

Onderdrukkingen kunnen worden gebruikt om de hierboven gedefinieerde parameterwaarden te wijzigen voor alle exemplaren of voor specifieke exemplaren of groepen.

Element properties:

TargetMicrosoft.MySQLServer.ManagedServer.Unix
Parent MonitorMicrosoft.MySQLServer.QueryCachePerformanceRollup
CategoryPerformanceHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityMatchMonitorHealth
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.Oss.WSManEnumeration.GreaterThanThreshold.ThreeState.MonitorType
RemotableTrue
AccessibilityPublic
Alert Message
Percentage weghalingen uit cache voor query's van MySQL-server
Het huidige percentage ({0}\%) weghalingen uit de cache voor query's voor de MySQL-server is hoog
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.MySQLServer.ManagedServer.Unix.QueryCachePrunesPct.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.QueryCachePrunesPct.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 Prunes 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(.)='QCachePrunesPct']$</Value>
<WarningThreshold>70</WarningThreshold>
<ErrorThreshold>80</ErrorThreshold>
<NumSamples>3</NumSamples>
</Configuration>
</UnitMonitor>