demystifying sql performance on azure vm...

21
Demystifying SQL Performance on Azure VM (IaaS) Pranab Mazumdar - Escalation Engineer

Upload: others

Post on 25-May-2020

17 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Demystifying SQL Performance on Azure VM (IaaS)developermarch.com/developersummit/2015/report/... · Windows Azure VM Size & Bandwidth VM Size CPU Cores Memory Max Disk Sizes Max

Demystifying SQL Performance on Azure VM (IaaS)

Pranab Mazumdar - Escalation Engineer

Page 2: Demystifying SQL Performance on Azure VM (IaaS)developermarch.com/developersummit/2015/report/... · Windows Azure VM Size & Bandwidth VM Size CPU Cores Memory Max Disk Sizes Max

About Me

Page 3: Demystifying SQL Performance on Azure VM (IaaS)developermarch.com/developersummit/2015/report/... · Windows Azure VM Size & Bandwidth VM Size CPU Cores Memory Max Disk Sizes Max

Today’s Transformation – Cloud

Page 4: Demystifying SQL Performance on Azure VM (IaaS)developermarch.com/developersummit/2015/report/... · Windows Azure VM Size & Bandwidth VM Size CPU Cores Memory Max Disk Sizes Max

Session Objectives And Takeaways

Deploying a SQL Server instance with

best practices

Track best practice compliance

Best Practices

Leveraging Azure VM Characteristics

Performance Consideration- KPIs

Page 5: Demystifying SQL Performance on Azure VM (IaaS)developermarch.com/developersummit/2015/report/... · Windows Azure VM Size & Bandwidth VM Size CPU Cores Memory Max Disk Sizes Max

DemoDeploying a SQL

Server instance with best practices

Page 6: Demystifying SQL Performance on Azure VM (IaaS)developermarch.com/developersummit/2015/report/... · Windows Azure VM Size & Bandwidth VM Size CPU Cores Memory Max Disk Sizes Max

Key SQL performance Considerations

KPIs Throughput Response time (aka latency)

Dimensions

Metric OLTP DW Log

Read/Write mix Mostly reads, smaller # of rows at a time

Scan intensive, large portions of data at a time, bulk loading

Mostly writes, requires low latency

IO size and pattern Between 8 and 64K, mostly random

1 64KB read per 8 512KB reads, Mostly sequential MB/s a critical metric

Highly sequential

# users high low n/a

Page 7: Demystifying SQL Performance on Azure VM (IaaS)developermarch.com/developersummit/2015/report/... · Windows Azure VM Size & Bandwidth VM Size CPU Cores Memory Max Disk Sizes Max

Key Windows Azure VM Characteristics

Architecture Latency

VariabilityConfiguration

options

Disk latency >50ms is bad

Measure Avg. Disk Sec/Transfer

SOS if latency >150 ms consistently <150 ms latency is normal

Page 8: Demystifying SQL Performance on Azure VM (IaaS)developermarch.com/developersummit/2015/report/... · Windows Azure VM Size & Bandwidth VM Size CPU Cores Memory Max Disk Sizes Max

VM Configuration Options

VM Size

Network Bandwidth

Disk Type and Configuration

Disk Cache Setting

Page 9: Demystifying SQL Performance on Azure VM (IaaS)developermarch.com/developersummit/2015/report/... · Windows Azure VM Size & Bandwidth VM Size CPU Cores Memory Max Disk Sizes Max

Windows Azure VM Size & BandwidthVM Size CPU Cores Memory Max Disk Sizes Max Data Disks

(1 TB Each)Max IOPS

Basic Tier

A0\Basic_A0 –A4\Basic_A4

1 – 8 768 MB – 14 GB OS: 1 TBTemp: 20 GB –240 GB

1 – 16 1x300 -16x300

Standard Tier – A series and D series

A0\Extra Small –A4 Extra Large

1-8 768 MB – 14 GB OS: 1 TB Temp: 605 GB

1 – 16 1x500 -16x500

A5 – A11 2 – 16 14 GB – 112 GB OS: 1 TBTemp: 382 GB

4 - 16 4 x 500 -16 x 500

Standard_D1 –Standard_D14

1 – 16 3.5 GB – 112 GB OS: 1 TBTemp (SSD): 50 GB - 800 GB

2 – 32 2x500 -32x500

Standard tier – DS series

Standard_DS1-Standard_DS14

1 – 16 3.5 – 112 GB OS: 1 TBLocal(SSD): 7 GB –224 GB

2 – 32 3,200 - 50,00032 mb/sec –512 mb/sec

Standard tier – G series

Standard_G1-Standard_G5

2 – 32 28 GB – 448 GB OS: 1 TBLocal: 384 GB –6144 GB

4 – 64 4x500 –64x500

Page 10: Demystifying SQL Performance on Azure VM (IaaS)developermarch.com/developersummit/2015/report/... · Windows Azure VM Size & Bandwidth VM Size CPU Cores Memory Max Disk Sizes Max

Windows Azure IO subsystem

Disk implemented as Shared multi-tenant service.

Built-in triple redundancy , optional geo redundancy.

Performance less predictable than on-prem.

Host machines, storage services, network bandwidth shared between subscribers

Perf can depend on where and when VM is provisioned

Subject to maintenance operations

Granular control & configurability vs. cost, simplicity, out of box redundancy

Page 11: Demystifying SQL Performance on Azure VM (IaaS)developermarch.com/developersummit/2015/report/... · Windows Azure VM Size & Bandwidth VM Size CPU Cores Memory Max Disk Sizes Max

VM Disk Types & Configurations

OS Disk● Persistent

● SATA

● Default Cache (Read, write)

● C drive

● 127GB Max size

Temporary Storage Disk● Local (Not persistent)

● D drive ( SSD For D/DS

Series)

● Shared across VMs

● Transient data storage & OS

page files

Data Disks● Persistent

● SCSI

● Default No Cache

● Customer Defined Letter

Page 12: Demystifying SQL Performance on Azure VM (IaaS)developermarch.com/developersummit/2015/report/... · Windows Azure VM Size & Bandwidth VM Size CPU Cores Memory Max Disk Sizes Max

Guiding Principles – SQL on IaaS

No more Storage Admin Follow Best Practices

Local is good

Page 13: Demystifying SQL Performance on Azure VM (IaaS)developermarch.com/developersummit/2015/report/... · Windows Azure VM Size & Bandwidth VM Size CPU Cores Memory Max Disk Sizes Max

Page Blobs –512 byte size

page

No SLA guaranteed latency yet*

Avg. Disk Sec/Transfer is bad only when >150

msconsistently

“Warm-up effect” after ~20 mins of

inactivity

Performance degradation

during warm-up

(~10 mins)

Good to Know!!!

13

Page 14: Demystifying SQL Performance on Azure VM (IaaS)developermarch.com/developersummit/2015/report/... · Windows Azure VM Size & Bandwidth VM Size CPU Cores Memory Max Disk Sizes Max

Storage Account

Storage account limit: 20,000 IOPs

Data Disk limit: 500 IOPs

(for 8KB on Standard tier and above)

Be aware of Ingress/Egress

limits

Caching policy = NONE for data disks

Disable GEO-replication on

storage account

Storage Cheat Sheet

Page 15: Demystifying SQL Performance on Azure VM (IaaS)developermarch.com/developersummit/2015/report/... · Windows Azure VM Size & Bandwidth VM Size CPU Cores Memory Max Disk Sizes Max

Storage Cheat Sheet

SQL Server

SSD drives for tempdb or BPE on D-

Series ONLY

Separate data disks for data and log files

Windows

Change column count

to appropriately

64-KB allocation unit size

Use Storage Spaces or OS

striping

Page 16: Demystifying SQL Performance on Azure VM (IaaS)developermarch.com/developersummit/2015/report/... · Windows Azure VM Size & Bandwidth VM Size CPU Cores Memory Max Disk Sizes Max

Cheat Sheet – SQL Server

16

SQL Server

Use Lock Pages In Memory

Enable instant file

initialization

Database

Disable autoshrink &

Avoid autogrow

Use database

page compression

Backup to URL with

compressed backups

Page 17: Demystifying SQL Performance on Azure VM (IaaS)developermarch.com/developersummit/2015/report/... · Windows Azure VM Size & Bandwidth VM Size CPU Cores Memory Max Disk Sizes Max

DemoDeploying a SQL

Server instance with best practices

Page 18: Demystifying SQL Performance on Azure VM (IaaS)developermarch.com/developersummit/2015/report/... · Windows Azure VM Size & Bandwidth VM Size CPU Cores Memory Max Disk Sizes Max

http://go.microsoft.com/fwlink/?LinkId=306266

Page 19: Demystifying SQL Performance on Azure VM (IaaS)developermarch.com/developersummit/2015/report/... · Windows Azure VM Size & Bandwidth VM Size CPU Cores Memory Max Disk Sizes Max

ResourcesReading

White paper: Performance Guidance for SQL Server in Windows Azure Virtual Machines

SQL IaaS BasicsSQL Server in Windows Azure Virtual MachinesSQL Server HA/DR on IaaS

Windows Azure StorageWindows Azure Storage: A Highly Available Cloud Storage Service with Strong ConsistencyErasure Coding in Windows Azure StorageSQL Server Backup and Restore with Windows Azure Blob Storage Service

SQL Server PerformanceAnalyzing I/O Characteristics and Sizing Storage Systems for SQL Server Database ApplicationsCompilation of SQL Server TempDB IO Best Practices

Page 20: Demystifying SQL Performance on Azure VM (IaaS)developermarch.com/developersummit/2015/report/... · Windows Azure VM Size & Bandwidth VM Size CPU Cores Memory Max Disk Sizes Max

Session Objectives And Takeaways

Not following Best Practices – Expect

Severe Performance

Configure Tempdbcorrectly

Be Updated

Deploying to nearest DC will help

Use PowerShell & Deploy with best

Practices

Page 21: Demystifying SQL Performance on Azure VM (IaaS)developermarch.com/developersummit/2015/report/... · Windows Azure VM Size & Bandwidth VM Size CPU Cores Memory Max Disk Sizes Max