Download presentation
Presentation is loading. Please wait.
Published byDirk Dennis Kaiser Modified over 6 years ago
1
SQL Server performance tuning on Azure IaaS
Marco Obinu SQL Server performance tuning on Azure IaaS
3
Who am I Advisory Engineer @ Softjam S.p.A.
Microsoft Certified Professional for SQL Server and SharePoint SQL Saturday, PASS GIVC, SiD and so on Geek to the bone @OmegaMadLab
4
Agenda Infrastructure as a Service: Why & When?
Microsoft best practices overview Virtual machine sizing Post-deployment optimization Hints for automation
5
IaaS: Why & When?
6
IaaS: Why & When? Traditional IT IaaS PaaS SaaS APPLICATION HYPERVISOR
OS RUNTIME DATA STORAGE NETWORK SERVERS YOU MANAGE Traditional IT MANAGED BY VENDOR APPLICATION HYPERVISOR OS RUNTIME DATA STORAGE NETWORK IaaS YOU MANAGE SERVERS MANAGED BY VENDOR APPLICATION HYPERVISOR OS RUNTIME DATA STORAGE NETWORK PaaS YOU MANAGE SERVERS MANAGED BY VENDOR APPLICATION HYPERVISOR OS RUNTIME DATA STORAGE NETWORK SaaS SERVERS
7
IaaS: Why & When? SQL Server instance inside an Azure VM
Same SQL Server features available as on on-premises instances You own full control over instance Fast and agile deployment with templates Pay-as-you-go or Bring Your Own License Dev/Test Lift and Shift Disaster Recovery scenarios
8
Microsoft best practices
9
Overview
10
VM provisioning phase
11
Key components for a fast SQL Server VM
Governed by VM size Optimization can make the difference!
12
Choose a storage type SSD - Premium Storage HDD - Standard Storage
Production environments – heavy workloads 99,9% SLA for a single VM if used on all disks VM families DS, DSv2, ES, FS, GS, LS, etc. Storage account limits: 50 Gbps bandwidth 35 TB for disks 10 TB for snapshots Dev/test environments – light workloads No SLA available for single VM VM families VM A, Av2, D, Dv2, F, G, L, N, H, etc. Storage account limits: KB 500 TB total capacity Use Premium Storage Account with local replica (Premium LRS) deployed in the same datacenter used by the VM Geo-replicated storage account (Standard GRS) partially supported use SQL Server features to deploy geo-redundant solutions
13
Choose a VM family – Azure compute unit
Single core performance, referred to an A-family core SKU Family ACU/Core Standard_A0 50 Standard_A1-4, Standard_A5-7, Standard_A1-8v2, Standard_A2m-8mv2 100 A8-A11 225* D1-14, DS1-14 160 D1-15v2, DS1-15v2 * Dv3, DSv3, Ev3, ESv3 * ** F1-F16, F1s-F16s F2Sv2-F72Sv2 * ** G1-5, GS1-5, L4s-L32s * H * M ** * use Intel® Turbo technology to increase CPU frequency and provide a performance boost. ** Hyper-Threaded hosts (1 physical core = 2 vCpu)
14
Choose a VM family – VM size
Premium Storage VMs Standard Storage VMs VM families: DS, DSv2, DSv3, ESv3, FS, GS, etc. Choose a size considering: # of vCPU RAM needed # of data disks Max IOPS and disk bandwidth NIC performance VM families: DS, DSv2, DSv3, ESv3, FS, GS, etc. Choose a size considering: # of vCPU RAM needed # of data disks NIC performance Minimum recommended size: DS2 (2 vCPU – 7 GB RAM) for SQL Server Standard Edition DS3 (4 vCPU – 14 GB RAM) for SQL Server Enterprise Edition
15
Choose a VM family – Storage subsystem
Premium Storage VMs Standard Storage VMs Managed disks, unmanaged disks Fixed sizes with provisioned performance tiers Minimum recommended sizing: Min. 1 x P30 for datafile and TempDB Min. 1 x P30 for logfile Cache settings: Read-only for datafile e TempDB None for logfile Managed disks fixed size Unmanaged disks user defined size, up to 4 TB Same unprovisioned performance, regardless of size Recommended sizing: Use striped disks up to the VM capacity Cache set to “None” for every SQL disk type Premium Disks Size IOPS Throughput P4 32 GB 120 25 MB/s P6 64 GB 240 50 MB /s P10 128 GB 500 100 MB/s P15 256 GB 1100 125 MB/s P20 512 GB 2300 150 MB/s P30 1 TB 5000 200 MB/s P40 2 TB 7500 250 MB/s P50 4 TB Standard Man. Disks Size IOPS Throughput S4 32 GB 500 60 MB/s S6 64 GB S10 128 GB S15 256 GB S20 512 GB S30 1 TB S40 2 TB S50 4 TB Stripe more disks with Storage Spaces Columns = # of disks; interleave = 64KB (OLTP) or 256KB (DW) Format volumes with 64 KB allocation unit size
16
VM provisioning phase - recap
17
Post deployment tasks
18
Post deployment – I/O optimizations
Avoid using OS disk to hosts databases, ERRORLOG and Default Trace Move to additional data disks Set default paths for databases and backups Move MSDB, MODEL, TEMPDB: ALTER DATABASE database_name MODIFY FILE ( NAME = logical_name , FILENAME = 'new_path\os_file_name' ) Move files on disks Restart SQL Server instance Move MASTER, SQL Server logs and Default Trace: Stop SQL Server instance Open SQL Configuration Manager and update startup parameters
19
Post deployment – I/O optimizations
Keep database size under control Autogrowth = last chance preallocate size Disable Auto Shrink causes huge I/O and increase index fragmentation Assign privileges to SQL Server Service account Perform volume maintenance tasks to enable Instant File Initialization it works on data files only!!! Lock Pages in Memory to limit SQL Server memory pagination to disk Consider to enable Page Compression on tables and indexes On SQL Server 2012 install at least SP1 CU10 or SP2 CU1 to fix IO issues
20
Post deployment – Backup to Azure
Consider to offload backups on a storage account
21
Post deployment tasks - recap
22
Post deployment tasks – additional tips
Disable unwanted services (SSAS, SSRS) Set max server memory to avoid memory contention with OS Split TempDB into more data files Consider using temporary disk for TempDB Consider using specific trace flags if using SQL 2012/2014. Defaults: -T1117 and -T1118 if you choose OLTP workload -T1117 and -T610 if you choose DW workload
23
Automation
24
Automation PowerShell ARM Template dbatools.io
PowerShell Desired State Configuration Azure Custom Script Extension
25
Usefull info… Official docs GitHub Azure Quickstart Templates
GitHub Azure Quickstart Templates SQL Server optimized template Optimize-SqlVmIaas PoSH script Look for my social channels for updates @OmegaMadLab
26
Q&A
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.