Download presentation
Presentation is loading. Please wait.
1
SQL Server performance tuning on Azure IaaS
Marco Obinu SQL Server performance tuning on Azure IaaS
2
Sponsor
3
Who am I Senior Technical Specialist @ Softjam S.p.A.
Microsoft Certified Professional for SQL Server and SharePoint 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
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
12
Choose 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)
13
Choose 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
14
Choose VM family – VM Size
Premium Storage VMs Standard Storage VMs Fixed size disks: Recommended: at least one P30 disk for datafile and TempDB and at least on P30 disk for logfile Cache settings: Read-only for datafile e TempDB None for logfile Max 4 TB capacity for each disk Max 500 IOPS for each disk Max 60 MB/s for each disk Cache set to “None” for each SQL disk Use striped disks up to the VM capacity Premium Disks Type 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 Stripe more disks with Storage Spaces Columns = # of disks; interleave = 64KB (OLTP) or 256KB (DW) Format volumes with 64 KB allocation unit size
15
VM provisioning phase - recap
16
Post deployment tasks
17
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
18
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
19
Post deployment – Backup to Azure
Consider to offload backups on a storage account
20
Post deployment tasks - recap
21
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
22
Automation
23
Automation Script PowerShell ARM Template
PowerShell Desired State Configuration
24
Useful info… Official docs GitHub Azure Quickstart Templates
GitHub Azure Quickstart Templates Look for my social channels to get demo scripts in few days (or weeks ) @OmegaMadLab
25
Q&A
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.