achieving peak performance from your virtualized sql servers

33
Achieving Peak Performance From Your Virtual SQL Servers DBA-218 David Klee, Founder Heraflux Technologies

Upload: heraflux

Post on 16-Jul-2015

154 views

Category:

Data & Analytics


0 download

TRANSCRIPT

Page 1: Achieving Peak Performance from your Virtualized SQL Servers

Achieving Peak PerformanceFrom Your Virtual SQL Servers

DBA-218David Klee, Founder

Heraflux Technologies

Page 2: Achieving Peak Performance from your Virtualized SQL Servers

About David Klee

@kleegeekdavidklee.netgplus.to/kleegeeklinked.com/a/davidaklee

Specialties / Focus Areas / Passions:

• Performance Tuning• Virtualization• Infrastructure• Troubleshooting

• High Availability• Disaster Recovery• Capacity Management• Health & Efficiency

Page 3: Achieving Peak Performance from your Virtualized SQL Servers

Please silence cell phones

Page 5: Achieving Peak Performance from your Virtualized SQL Servers

Session Evaluations

ways to access

Go to

passsummit.com/evals

Download the GuideBook App

and search: PASS Summit 2014

Follow the QR code link displayed

on session signage throughout the

conference venue and in the

program guide

Submit by 11:59 PM ESTFriday Nov. 7 toWIN prizes

Your feedback is important and valuable.

Evaluation Deadline:

11:59 PM EST, Sunday Nov. 16

Page 6: Achieving Peak Performance from your Virtualized SQL Servers

• What is Virtualization?

• What does Virtualization Mean for DBAs?

• Environmental Design & Performance Impact

• SQL Server Virtual Machine Construction

• SQL Server Workload Sizing

• It’s all About the Performance!

Agenda

Page 7: Achieving Peak Performance from your Virtualized SQL Servers

• Most DBA’s virtualization experience…

• Added layer – removes hardware dependency from the

OS and above

• Hardware treated as physical resources

• All resources have queues

• Expect equivalent performance

What is Virtualization?

Page 8: Achieving Peak Performance from your Virtualized SQL Servers

Historical Physical Model

SAN Disk Pool

Local Disks (OS, Instance Home)

SQL Server A

SQL Server B

Data

Logs

Data

Logs

Page 9: Achieving Peak Performance from your Virtualized SQL Servers

Today’s Virtualization Model

SAN Disk Pool

LUN

LUN

LUN

VIR

TU

ALI

ZA

TIO

NVM

VM

VM

Page 10: Achieving Peak Performance from your Virtualized SQL Servers

• Single compute node hardware

• Total cluster compute capacity

• Storage speed (IOPs, throughput)

• VM maximums

• Interconnect path speed

Hard Limits (Resources) Soft Limits (Queues)

• Memory oversubscription

• CPU scheduler contention

• Shared resource utilization

• Variable resource utilization levels

• “Noisy Neighbors”

Hard vs. Soft Limits

Page 11: Achieving Peak Performance from your Virtualized SQL Servers

Resources

150 GHzCPU

4 TBMemory

4x10GbE

Network20 TBTier 1

Storage

40 TBTier 2

Storage

VM16 vCPU

128 GB vRAM

VM8 vCPU

64 GB vRAM

VM2 vCPU16 GB vRAM

VM2 vCPU16 GB vRAM

VM2 vCPU16 GB vRAM

VM2 vCPU16 GB vRAM

VM2 vCPU16 GB vRAM

VM2 vCPU16 GB vRAM

V I R T U A L I Z A T I O N

Page 12: Achieving Peak Performance from your Virtualized SQL Servers

Queues

Hy

pe

rv

iso

r CPU SchedulerCPU

ExecutionCPU Scheduling Queue

Memory AllocatorMem R / W

Mem Allocation Queue

Disk SchedulerDisk R / W

Disk Scheduling Queue

Network SchedulerNetworkTran / Rec

Network Scheduling Queue

VM TASK

VM TASK

VM TASK

VM TASK

VM TASK

Page 13: Achieving Peak Performance from your Virtualized SQL Servers

• Resource limits are easy to detect / work around

• Queue contention much harder

• Time in queue = time lost from VM

• Silent performance killer

• Everything in a VM must be scheduled

• … including idle resources

• Queue processing is not always FIFO

Goal: Minimize Queue Waits

Page 14: Achieving Peak Performance from your Virtualized SQL Servers

• VMs cannot span physical servers

• Fastest CPU cores vs. overall core count

• Maximize host memory capacity

• No host memory overcommitment

• Monitor resource consumption & contention metrics

Host – Physical Server

Page 15: Achieving Peak Performance from your Virtualized SQL Servers

• Most shared

• Most critical

• Most complex

• Most problematic

• Slowest piece of the stack

• Random I/O disk patterns

• Many individual points of contention

Storage

Page 16: Achieving Peak Performance from your Virtualized SQL Servers

Storage – Contention Points

Controller

Controller

LUN

LUN

LUN

LUN

Disk Pool

VM

VM

VM

VM

Page 17: Achieving Peak Performance from your Virtualized SQL Servers

• Test raw performance• SQLIO Batch

bit.ly/1mEAS9W

• DiskSpdbit.ly/1CeQauw

• Collect metrics:

• I/Os per second (IOPs)

• Latency (ms)

• Throughput (MB/s)

Storage - Maximums

0.00

10000.00

20000.00

30000.00

40000.00

50000.00

60000.00

70000.00

1 2 4 8 16 32 64 128

IOps

Thread Intensity

IOps Per Operations per Thread

Sequential Read

Random Read

Sequential Write

Random Write

Page 18: Achieving Peak Performance from your Virtualized SQL Servers

• Huge performance bottleneck potential

• Get fastest possible!

• Get most possible!

• Multi-pathing configuration / software

• Vendor-recommended HBA queue depth settings

• Verify and test end-to-end performance

Network & Storage Interconnects

Page 19: Achieving Peak Performance from your Virtualized SQL Servers

• Verify network end-to-end performance

• Use iperf to test network throughput

• bit.ly/1eDCYbi

• How-To Guide: bit.ly/YET53p

Network Throughput Testing

Page 20: Achieving Peak Performance from your Virtualized SQL Servers

• Co-locate VMs on same physical machine

• Same vNetwork, improved performance

Physical Proximity

Page 21: Achieving Peak Performance from your Virtualized SQL Servers

• CPU

• vCPU counts

• vNUMA configuration

• Hot-add?

• Memory

• Full memory reservation

• Dynamic memory

• Hot-add?

VM Configuration

• Storage

• Virtual disks whenever

possible

• Multiple virtual disks

“Right-Size” it!

Page 22: Achieving Peak Performance from your Virtualized SQL Servers

• “Right” amount of vCPU and vRAM resources

• Physical world = Size for end of life

• Virtual world = Size for right now

• Idle vCPUs will slow application VMs performance

• Analyze performance baselines and determine

the resources you need

• Repeat “right-sizing” analysis routinely

“Right-Sizing” the VM

Page 23: Achieving Peak Performance from your Virtualized SQL Servers

• Not done at just vCPU count

• vNUMA configuration also matters

• Closely align with pNUMA

• Adds efficiency by aligning with underlying hardware

• Performance difference improves with larger VMs

CPU Sizing - NUMA

Page 24: Achieving Peak Performance from your Virtualized SQL Servers

• Get physical machine configuration

• Try to fit VM inside one NUMA node

• Otherwise, balance across number

of NUMA nodes

• Test configurations for best results

CPU Sizing - vNUMA

Page 25: Achieving Peak Performance from your Virtualized SQL Servers

• Example: 16 vCPU VM

• What’s better?

• 2 vSocket x 8 vCore?

• 4 vSocket x 4 vCore?

• 8 vSocket x 2 vCore?

• Varies by workload,

hardware

• Test it for yourself!

CPU Sizing – vNUMA Results

0

100000

200000

300000

400000

500000

600000

700000

800000

900000

8 16 64 256

Tra

nsa

ctio

ns

/ m

inConcurrent HammerDB Users

vNUMA SQL Server Scalability - 16 vCPUs - HammerDB

4socket x 4CPU 8socket x 2CPU 2socket x 8CPU

Page 26: Achieving Peak Performance from your Virtualized SQL Servers

• SQL Server data must be in buffer pool

• More memory ≈ less I/O

• Less I/O = less waiting on shared storage & queues

• NO HOST MEMORY OVERCOMMITMENT

• Too much memory = lower consolidation ratio

• Balancing act

Memory

Page 27: Achieving Peak Performance from your Virtualized SQL Servers

C: - Operating System

D: - SQL Server Instance Home

E: - System Databases (master, model, msdb) *

F: - User Database Data (1 of X)

G: - User Database Log (1 of Y)

H: - TempDB

Y: - Windows Page file **

Z: - Backups

vDisk Layout

Adjust as necessary

(but stay standardized)

Page 28: Achieving Peak Performance from your Virtualized SQL Servers

• Set power settings to “High Performance” (CPU-Z)

• Set antivirus exclusions for SQL Server (tinyurl.com/sqlav)

• Ongoing OS-level performance metric collection

• No greater than five minute interval

• 24 x 7, not just as-needed

• Windows Perfmon, Microsoft SCOM,

or any other third-party utility

• tinyurl.com/kleeperfmon

Operating System

Page 29: Achieving Peak Performance from your Virtualized SQL Servers

• Goal: Maximize performance while reducing resource

scheduling

• Parallelizable workloads

• Determine how parallel the workload is

• Set MaxDOP = vNUMA node core count (?)

• Cost threshold for parallelism = Not default

SQL Server

Page 30: Achieving Peak Performance from your Virtualized SQL Servers

• Spread out the I/O

• File groups, data files, partitions

• Parallelism with multiple active storage paths

• Reduce I/O

• Table & index compression

• In-memory constructs

• More RAM

• SSD read / write caching

SQL Server Database

Page 31: Achieving Peak Performance from your Virtualized SQL Servers

• You can virtualize it successfully!

• Understand your SQL Server workloads• Individual

• Aggregate

• “Right-size” your VMs & baseline performance

• Routinely check ongoing performance

Conclusions

Page 32: Achieving Peak Performance from your Virtualized SQL Servers

Contact Me!davidklee.net @kleegeek

Page 33: Achieving Peak Performance from your Virtualized SQL Servers

Questions?Thanks for attending!