Performance Monitoring Alwayson Availability Groups: Anthony E. Nocentino
Performance Monitoring Alwayson Availability Groups: Anthony E. Nocentino
AlwaysOn Availability
Groups
Anthony E. Nocentino
[email protected]
Anthony E. Nocentino
• email: [email protected]
• Twitter: @nocentino
• Blog: www.centinosystems.com/blog
• Motivation
• How availability groups move data
• Impact of replication latency on availability
• Monitoring techniques
• Demo
• Dealing with replication latency
Why is this important?
• Recovery Objectives
• Recovery Point Objective - RPO
• Recovery Time Objective - RTO
• Availability
• How much data can we lose?
• How fast will the system fail over?
• Monitoring and Trending
• Establish a baseline for analysis - are we meeting those objectives?
• Impact on resources
• Ownership
• All of the components are monitored by the DBA
Data Movement In Availability Groups
• Not synchronizing
• Synchronized
• Synchronizing
• Reverting
• Initializing
https://msdn.microsoft.com/en-us/library/ff877972.aspx
Failover Modes
• Automatic
• Synchronous mode only
• Commonly used within a data center
• Synchronization state must by synchronized
• Manual
• Synchronous or Asynchronous
• Commonly used between data centers
https://msdn.microsoft.com/en-us/library/hh213151.aspx
Send Queue
• Primary
• SQLServer:Databases - Log Bytes Flushed/sec
• SQLServer:Availability Replica - Bytes Sent to Replica/sec (compressed)
• Network Interface - Bytes Sent/sec
• Secondaries
• SQLServer:Availability Replica - Bytes Received From Replica (compressed)
• SQLServer:Database Replica - Log Bytes Received/sec (log send rate/decompressed)
• SQLServer:Database Replica - Redone Bytes/sec (log redo rate)
• Network Interface - Bytes Received/sec
Measuring Latency with Extended Events
In SQL 2014 - SP2
Primary
Each event has a measure duration
hadr_log_block_group_commit
log_block_pushed_to_logpool
log_flush_start
hadr_log_block_compression
hadr_capture_log_block
ucs_connection_send_msg Synchronous Secondary
hadr_log_block_send_complete hadr_transport_receive_log_block_message
log_flush_complete hadr_log_block_decompression
hadr_apply_log_block
log_block_pushed_to_logpool
log_flush_start
log_flush_complete
hadr_send_harden_lsn_message
hadr_receive_harden_lsn_message ucs_connection_send_msg
hadr_db_commit_mgr_harden hadr_lsn_send_complete
Monitoring Tools
109GB
248GB
Dealing With Slow Replication Latency
• Identify your bottleneck and mitigate it
• Minimize log generation
• Use smart index maintenance/Better Indexes
• More bandwidth
• Perhaps a dedicated network connection
• Better hardware
• Log throughput on secondaries needs to be equal to primary
• Upgrade SQL Server
• 2012 single threaded redo - ~45MB/sec
• 2016 multi-threaded redo - ~600MB/sec
Key Takeaways
• It is imperative to track and trend replication latency in your
Availability Groups so you can answer the questions
• How much data can will I lose?
• How long it will take to failover?
• Monitor and trend send_queue and redo_queue in
sys.dm_hadr_database_replica_states on replicas to
measure availability impact
• Understand how much log is generated in your databases
• Understand your system’s operations, consider downtime for
patching and network maintenance
Key Takeaways
http://www.centinosystems.com/blog/talks/
Links to resources
Demos
Presentation
[email protected]
Free SQL Monitor!
What was that “one thing” you walked away with from today’s talk?
[email protected]
3 0 0 0!!!
T H $
WO R
D E A L e t :)
ING Tw e
A Z … a
A N AM s t s of
IS IS he c o
T H fo r t
u r s
Yo
Thank You!
http://www.sqlsaturday.com/540/sessions/sessionevaluation.aspx
• http://www.centinosystems.com/blog/sql/designing-for-offloaded-
backups-in-alwayson-availability-groups/
• http://www.centinosystems.com/blog/sql/designing-for-offloaded-
log-backups-in-alwayson-availability-groups-monitoring/
• http://www.centinosystems.com/blog/sql/monitoring-availability-
groups-with-redgates-sql-monitor
• https://msdn.microsoft.com/en-us/library/ff878537.aspx
• https://msdn.microsoft.com/en-us/library/ff877972.aspx