Lazy writer and Checkpoint statistics


Job details

Name: Lazy writer and Checkpoint statistics
Platform: Sqlserver
Category: Performance
Description: Monitors ‘Checkpoint pages/sec’, ‘Lazy writes/sec’ and ‘Page life expectancy’ by extracting counter values from the sys.dm_os_performance_counters performance table.
Long description: Lazy writer purpose is to release the buffer pool memory. When more memory is needed, lazy writer responds to a memory pressure releasing the “coldest” pages from the buffer pool, and makes more memory available for new pages to come in.
Version: 1.3
Default schedule: 4,14,24,34,44,54 * * *
Requires engine install: Yes
Compatibility tag: .[type=‘instance’ & databasetype=‘sqlserver’]/instance[maj_version > ‘2005′ & hasengine=‘YES’ & (engine_edition = ‘Microsoft SQL Server’ engine_edition = ‘Azure SQL Managed Instance’)]

Parameters

Name Default value Description
keep data for 10 Number of days to provide statistics for.
keep aggregated statistics for 360 Removes aggregate statistics older than this threshold (in days) from the tables dbw_lazy_writer_aggr and dbw_page_life_exp_aggr.

Job Summary

SELECT cntr_value, object_name FROM sys.dm_os_performance_counters WHERE counter_name IN ('Checkpoint pages/sec', 'Lazy writes/sec', 'Page life expectancy');

Database and Job Configuration

Key Counters Monitored

Data Tables and Procedure Implementation

Upgrades and Maintenance

Reporting and Visualization

Conclusion

This monitoring job is essential for database administrators to ensure SQL Server’s optimal performance and stability, particularly in environments where high availability and efficient memory management are crucial.