页生存期

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

数据库引擎的页生存期

Knowledge Base article:

摘要

页生存期是某页在没有引用的情况下在缓冲池中将停留的秒数。较高的页生存期意味着可在缓存中找到所需数据,而不是转到硬盘。

原因

极低的页生存期值可能指示以下情况:

系统内存太小

为 SQL Server 使用配置的内存太小

索引设计不佳

解决方法

检查 I/O 系统以便确认在针对对象 PhysicalDisk 的 Average Disk sec/Read 和 Average Disk sec/Write 计数器的值较高(通常高于 10 毫秒)时(这意味着系统可能重载或者存在改进查询和索引机会)的情况下该 I/O 系统如何处理负荷。

缓冲池可能重载,因为 SQL Server 同时使用大量的表,或者使用完全扫描代替了按条件搜索。检查 SQL Server:访问方法:完全扫描/秒计数器以便确认该问题。

可以使用 SQL Server Profiler 并且在“性能”类别中浏览 Showplan 统计信息以便找到导致完全扫描的应用程序。

可替代参数

名称

说明

默认值

警报优先级

定义警报优先级。

正常

警报严重性

定义警报严重性。

错误

已启用

启用或禁用工作流。

生成警报

定义工作流是否生成警报。

间隔(秒)

运行工作流的重复间隔时间(秒)。

300

样本数

指示在状态发生更改之前测量值应违反阈值的次数。

6

同步时间

使用 24 小时格式指定的同步时间。可以忽略。

 

阈值

收集的值将与此参数进行比较。

300

超时(秒)

指定工作流在关闭之前允许运行的时间,并标记为失败。

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.PageLifeExpectancy
RemotableTrue
AccessibilityPublic
Alert Message
Windows 上的 MSSQL: 页生存期过低
计算机“{1}”上 SQL 实例“{0}”的页生存期过低。有关详细信息,请参阅“警报上下文”选项卡。
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.Windows.Monitor.DBEngine.PageLifeExpectancy" 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.PageLifeExpectancy" ConfirmDelivery="false">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.Windows.Monitor.DBEngine.PageLifeExpectancy.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>
<IntervalSeconds>300</IntervalSeconds>
<SyncTime/>
<Threshold>300</Threshold>
<NumSamples>6</NumSamples>
<TimeoutSeconds>200</TimeoutSeconds>
<SqlTimeoutSeconds>15</SqlTimeoutSeconds>
<PerformanceCounterObject>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/PerformanceCounterObject$</PerformanceCounterObject>
</Configuration>
</UnitMonitor>