SQL 2016 ALWAYSON
Sourabh K. Agarwal | Senior Program Manager
April 11 2017
@SQLSourabh
http://aka.ms/sqlserverteam | @mssqltiger
Agenda
Fundamental Changes to SQL Server 2016 AlwaysOn
Performance Enhancements to SQL Server 2016 AlwaysOn
Domain Independent AG’s
AlwaysOn Direct Seeding
Database Level Failover Detection
AlwaysOn Data Flow
Tracking AlwaysOn Latency
Fundamental Enhancements in SQL 2016
Readable secondary's load balancing
DTC support
Group Managed Service Account support
> 2 Auto-failover targets
Basic HA in Standard edition
SQL 2016 AlwaysOn Turbocharged
Streamline the Log
Transport
Parallel workers on
separate schedulers
Multiple Log Writers
Parallel Redo
Code Optimization
Read more on our blog
Domain Independent AGs
Environments have multiple domains that cannot be merged
No trust relationships
Installations that do not use Active Directory domains (Ex. Workgroups)
All nodes in a single domain
Nodes in multiple domains with full trust
Nodes in multiple domains with no trust
Nodes in no domain at all
Read our blog
docs
Requires combo of Powershell scripts, T-SQL scripts, SSMS, and Windows UI
blog blog
No need to initial full backups on primary
Network share not required
for backups
Automatic restores on secondary
Why Direct Seeding
VDI Stream - not compressed (use TF 9567)
Trade-off CPU v/s Network Bandwidth
Backup/Restore process - 1 worker per reader and writer per LUN
How it works
Extended Events - dbseed category (debug channel)
DMVs –
sys.dm_hadr_automatic_seeding
sys.dm_hadr_physical_seeding_stats
Diagnostics
Secondary AG Replica
VDI Stream
Primary AG
Replica
CREATE AVAILABILITY GROUP [ag]
WITH (DB_FAILOVER=ON)
FOR DATABASE [agdb]
Database level health Triggers
Enabled for entire AG
Log or data files read/write failures
Database state != ONLINE
sqlserver.availability_replica_database_fault_reporting XEvent
Only when SQL Server detects a problem
Independent of flexible failover policy Refresher here
Ex. When we write
to log
AlwaysOn
Data Flow
Primary Replica Secondary Replica
Capture Log Block
Compress Log Block
Send log block to the Secondary
Decompress Log Block
Harden Log Block
Send Ack back to Primary
Commit Transactions
Detecting AlwaysOn Latency
• Performance Counters
• Extended Events
• SSMS
• PowerBI
New in SQL 2016 SP1
Extended Events
recovery_unit_harden_log_timestamps
log_block_pushed_to_logpool
hadr_logblock_compression
hadr_log_block_decompression
hadr_transport_receive_log_block_message
hadr_log_block_group_commit
hadr_capture_filestream_wait
hadr_lsn_send_complete
hadr_receive_harden_lsn_message
log_flush_start
log_flush_complete
hadr_apply_log_block
hadr_capture_log_block
hadr_capture_vlfheader
hadr_log_block_send_complete
hadr_send_harden_lsn_message
ucs_connection_send_msg
Perfmon counters
Is there a simpler way?
Monitoring Always On Avaliability Group
Monitoring Always On Avaliability Group

Monitoring Always On Avaliability Group

  • 1.
    SQL 2016 ALWAYSON SourabhK. Agarwal | Senior Program Manager April 11 2017 @SQLSourabh http://aka.ms/sqlserverteam | @mssqltiger
  • 2.
    Agenda Fundamental Changes toSQL Server 2016 AlwaysOn Performance Enhancements to SQL Server 2016 AlwaysOn Domain Independent AG’s AlwaysOn Direct Seeding Database Level Failover Detection AlwaysOn Data Flow Tracking AlwaysOn Latency
  • 3.
    Fundamental Enhancements inSQL 2016 Readable secondary's load balancing DTC support Group Managed Service Account support > 2 Auto-failover targets Basic HA in Standard edition
  • 4.
    SQL 2016 AlwaysOnTurbocharged Streamline the Log Transport Parallel workers on separate schedulers Multiple Log Writers Parallel Redo Code Optimization Read more on our blog
  • 5.
    Domain Independent AGs Environmentshave multiple domains that cannot be merged No trust relationships Installations that do not use Active Directory domains (Ex. Workgroups) All nodes in a single domain Nodes in multiple domains with full trust Nodes in multiple domains with no trust Nodes in no domain at all Read our blog docs Requires combo of Powershell scripts, T-SQL scripts, SSMS, and Windows UI blog blog
  • 6.
    No need toinitial full backups on primary Network share not required for backups Automatic restores on secondary Why Direct Seeding VDI Stream - not compressed (use TF 9567) Trade-off CPU v/s Network Bandwidth Backup/Restore process - 1 worker per reader and writer per LUN How it works Extended Events - dbseed category (debug channel) DMVs – sys.dm_hadr_automatic_seeding sys.dm_hadr_physical_seeding_stats Diagnostics Secondary AG Replica VDI Stream Primary AG Replica
  • 8.
    CREATE AVAILABILITY GROUP[ag] WITH (DB_FAILOVER=ON) FOR DATABASE [agdb] Database level health Triggers Enabled for entire AG Log or data files read/write failures Database state != ONLINE sqlserver.availability_replica_database_fault_reporting XEvent Only when SQL Server detects a problem Independent of flexible failover policy Refresher here Ex. When we write to log
  • 9.
    AlwaysOn Data Flow Primary ReplicaSecondary Replica Capture Log Block Compress Log Block Send log block to the Secondary Decompress Log Block Harden Log Block Send Ack back to Primary Commit Transactions
  • 10.
    Detecting AlwaysOn Latency •Performance Counters • Extended Events • SSMS • PowerBI
  • 11.
    New in SQL2016 SP1 Extended Events recovery_unit_harden_log_timestamps log_block_pushed_to_logpool hadr_logblock_compression hadr_log_block_decompression hadr_transport_receive_log_block_message hadr_log_block_group_commit hadr_capture_filestream_wait hadr_lsn_send_complete hadr_receive_harden_lsn_message log_flush_start log_flush_complete hadr_apply_log_block hadr_capture_log_block hadr_capture_vlfheader hadr_log_block_send_complete hadr_send_harden_lsn_message ucs_connection_send_msg Perfmon counters
  • 12.
    Is there asimpler way?

Editor's Notes

  • #4 Recommendations and fixes for WSFC: https://support.microsoft.com/en-us/kb/2920151 Pre-requisites, Recommendation and Restrictions for Always ON Availability Group: https://msdn.microsoft.com/en-us/library/ff878487.aspx Readable secondaries load balancing: https://blogs.msdn.microsoft.com/alwaysonpro/2016/05/02/sql-server-2016-alwayson-availability-group-enhancements-load-balance-read-only-routing/ Log transport performance - https://blogs.msdn.microsoft.com/bobsql/2016/09/26/sql-server-2016-it-just-runs-faster-always-on-availability-groups-turbocharged/ Multiple automatic failover targets - https://blogs.msdn.microsoft.com/alwaysonpro/2016/05/02/sql-server-2016-alwayson-availability-group-enhancements-multiple-automatic-failover-targets/ Support for encrypted databases - https://blogs.msdn.microsoft.com/alwaysonpro/2016/06/23/sql-server-2016-alwayson-availability-group-enhancements-support-for-encrypted-databases/ Basic Availability Groups - https://msdn.microsoft.com/en-us/library/mt614935.aspx DTC support: https://msdn.microsoft.com/en-us/library/ms366279.aspx#dtcsupport
  • #10 During this Data flow, latency can happen on any of the following location Disk (Mostly on the Secondary) Network (Both Primary/Secondary) CPU
  • #13 Add in how to get there from SSMS Why not by default? How expensive is this?