Configuring SQL Server Mission Critical Scalable Deployments Suresh B. Kandoth Microsoft – Sr. Escalation Engineer
Session Objectives And Takeaways Target systems High-End CPUs / NUMA Large memory footprints High transaction rates Things you can do today File Configuration Trace Flags Memory Configuration sp_configure Windows settings SQL Server 2016 Changes Best Practices KB Article 2964518 2 | 11/14/2018 | Get more throughput from your systems
I/O and Database File Settings RG - IO Data Files (MDF/NDF) Growth Percent MB Instant File Initialization SE_MANAGE_VOLUME Tempdb Number of Files Startup Trace Flags 1118 & 1117 Local Fast Storage In-Memory replacement non-durable Buffer Pool Extension File sizing X of ‘max srv memory’ Fast storage on all nodes Config improvements [SQL 2014 SP1 - 3044952] Snapshot Files / Sparse Fragmentation Latest OS Large File Record Segment KB 967351 FORMAT /L ReFS Same Speed as LDF Filestream 8.3 naming Last Updated Time Garbage Collection 3 | 11/14/2018 | Good configuration – less pagers & no night calls
Transaction Log Configuration VLF initialization [0x00 or 0xC0 stamp] # of VLF [Recovery & Restore perf] VLF size change in SQL 2014 growth < 1/8 of current log size ? 1 VLF File settings 512 bytes, 4K, 512E Log shipping, High Availability [KB 3009974] Flush boundary (R)ead-(M)odify-(W)rite behavior Sector size 4 | 11/14/2018 | Log performance is very critical
Latest OS NUMA Improvements Memory Configuration -T8048 for CMemThread Binding Numa In Registry Vendor Guidance Numa Affinity Max Server Memory Lock Pages Large Pages Compatibility 5 | 11/14/2018 | Memory management isn’t that complicated
Plan Cache Other Caches Cache Configuration Increase Size of Cache Startup Trace Flag 8032 Increase Bucket Count of Cache Startup Trace Flag 174 Configuration Options Optimize for Adhoc workload Forced Parameterization Other Caches Security Token Cache Access check tokens Access Check Cache Bucket Count Access Check Cache Quota Login, User and Context tokens Trace Flag 4618 & 4610 Log Pool Cache Startup Trace Flag 9024 to partition pmo Startup Trace Flag 9023 to limit size CU fixes for leak & cache management 6 | 11/14/2018 | Take care of these caches well and they will take care of you
Other Scalability Considerations Download center Why Latest SP + CU Spatial PLE Eager Writes Cache contention DBCC changes VAS problems RG fixes Database Lock Partitioning Spatial Enhancements Query Optimizer Changes Activate QFE (Trace Flag 4199) Autostats Threshold (Trace Flag 2371) Table variable recompile (Trace flag 2453) 7 | 11/14/2018 | The latest build is the greatest !
Triple Check Before Upgrade Fix Levels, SPs and CUs Trace Flags Configuration Settings Firewall Service Accounts and Settings … 8 | 11/14/2018 | Do not leave anything behind, it will haunt you !
Configure SQL Server on IaaS [Azure VM] Use minimum Standard Tier A2 for SQL Server VMs. Keep the storage account and SQL Server VM in the same region. Disable Azure geo-replication on the storage account. Avoid using operating system or temporary disks for database storage or logging. Avoid using Azure data disk caching options (caching policy = None). Stripe multiple Azure data disks to get increased IO throughput. Format with documented allocation sizes. Separate data and log file I/O paths to obtain dedicated IOPs for data and log. Enable database page compression. Enable instant file initialization for data files. Limit or disable autogrow on the database. Disable autoshrink on the database. Move all databases to data disks, including system databases. Move SQL Server error log and trace file directories to data disks. Apply SQL Server performance fixes. Setup default locations. Enable locked pages. Backup directly to blob storage. Leverage Buffer Pool Extension on VM with SSD Configure tempdb on SSD when available 9 | 11/14/2018 | Footer Goes Here
Diagnostics Best Practices PssDiag SQL Nexus Sqldumper WPR WPA System Monitor Windows Event Logs SQL Error logs Cluster Logs System Health Session Ring buffers Extended Events 10 | 11/14/2018 | Footer Goes Here
Hot Spot Investigation - Extended Events Configure sessions Actions to Capture Partitioning & Memory Filters and map values Process XEvent Data SSMS aggregate/group/filter Call stack requirements Changes in future Reader, Writer, Sorting Duration & Time Drift Incorrect Information Stability 11 | 11/14/2018 | Footer Goes Here
Changes In SQL 2016 [Scalability and Performance] TempDB auto-config Memory Object auto-partition Query compilation robust Parallel redo Multiple Log Writers soft NUMA auto-config Schema Changes online Partition Management Always On AG Backup & Restore progress Query Progress easy identify Integrity Checks speed up Query Execution finer control Recovery progress tracking 12 | 11/14/2018 | Footer Goes Here
Additional references BPE enhancements in SQL Server 2014 SP1 Sparse file changes and fixes Virtual log file recommendations and changes Plan cache changes Statistics update threshold Table variable recompile Query Optimizer changes 13 | 11/14/2018 | Footer Goes Here