MySQL Server 可由缓冲池满足的命中占通过磁盘满足的命中的百分比。innodb 缓冲池包含最近最少使用的索引块。可使用全局变量 "innodb_buffer_pool_size" 控制缓冲池的大小。此监视器阈值是按照轮询过程中返回给代理的平均值分析的,其中“样本数”参数控制平均值计算中所包含的样本数。
运行不正常状态表示来自缓冲池的读取数与总读取数相比的百分比低。缓冲池可能没有足够空间可用于保存所有插入的块。
要解决缓冲池命中百分比低的问题,请尝试以下操作:
通过修改配置文件中的变量“innodb_buffer_pool_size”,增大 InnoDB 缓冲池的大小。
通过修改配置文件中的变量“innodb_buffer_pool_instances”,将缓冲池分为单独的实例以实现并发内存读写操作。
默认配置
参数 | 默认值 |
警告阈值 | 小于 95 |
错误阈值 | 小于 90 |
样本数 | 3 |
替代可用于更改以上为所有实例或为特定实例或组定义的参数值。
Target | Microsoft.MySQLServer.ManagedServer.Unix | ||
Parent Monitor | Microsoft.MySQLServer.InnoDBPerformanceRollup | ||
Category | PerformanceHealth | ||
Enabled | True | ||
Alert Generate | True | ||
Alert Severity | MatchMonitorHealth | ||
Alert Priority | Normal | ||
Alert Auto Resolve | True | ||
Monitor Type | Microsoft.Oss.WSManEnumeration.LessThanThreshold.ThreeState.MonitorType | ||
Remotable | True | ||
Accessibility | Public | ||
Alert Message |
| ||
RunAs | Default |
<UnitMonitor ID="Microsoft.MySQLServer.ManagedServer.Unix.InnoDB_BufferPool_HitPct.Monitor" Accessibility="Public" Target="Microsoft.MySQLServer.ManagedServer.Unix" TypeID="Oss!Microsoft.Oss.WSManEnumeration.LessThanThreshold.ThreeState.MonitorType" Enabled="onStandardMonitoring" ParentMonitorID="Microsoft.MySQLServer.InnoDBPerformanceRollup">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.MySQLServer.ManagedServer.Unix.InnoDB_BufferPool_HitPct.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>InnoDB Buffer Pool 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(.)='IDB_BP_HitPct']$</Value>
<WarningThreshold>95</WarningThreshold>
<ErrorThreshold>90</ErrorThreshold>
<NumSamples>3</NumSamples>
</Configuration>
</UnitMonitor>