Demystifying SQL Performance on Azure VM...
Transcript of Demystifying SQL Performance on Azure VM...
Demystifying SQL Performance on Azure VM (IaaS)
Pranab Mazumdar - Escalation Engineer
About Me
Today’s Transformation – Cloud
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
DemoDeploying a SQL
Server instance with best practices
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
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
VM Configuration Options
VM Size
Network Bandwidth
Disk Type and Configuration
Disk Cache Setting
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
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
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
Guiding Principles – SQL on IaaS
No more Storage Admin Follow Best Practices
Local is good
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
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
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
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
DemoDeploying a SQL
Server instance with best practices
http://go.microsoft.com/fwlink/?LinkId=306266
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
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