virtualization and san basics for dbas

42
1 VMs, SAN, SQL: The Big Threes Brent Ozar Quest Software Photo Licensed with Creative Commons From http://www.flickr.com/photos/ektogamat/2687444500/

Upload: quest-software

Post on 09-May-2015

1.587 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Virtualization and SAN Basics for DBAs

1

VMs, SAN, SQL:The Big Threes

Brent OzarQuest Software

Photo Licensed with Creative Commons From http://www.flickr.com/photos/ektogamat/2687444500/

Page 2: Virtualization and SAN Basics for DBAs

2

I’m Your Host: Brent Ozar• Microsoft Certified

Master• SQL Server MVP• Quest Software• Past Lives: DBA, SAN,

VMware admin• www.BrentOzar.com• Twitter: @BrentO

Page 3: Virtualization and SAN Basics for DBAs

3

Today’s Big Threes• 3 “Nevers” for VMs• 3 “Always” for SAN• 3 Metrics for Both

Photo Licensed with Creative Commons From http://www.flickr.com/photos/ektogamat/2687444500/

Page 4: Virtualization and SAN Basics for DBAs

4

Some Definitions

Page 5: Virtualization and SAN Basics for DBAs

5

Our Host• 2 Sockets

4 Cores Each• 64GB RAM• 1 Terabyte SAN

Photo Licensed with Creative Commons From http://www.flickr.com/photos/brento/1748661584/

Page 6: Virtualization and SAN Basics for DBAs

6

The Brochure Says…

Page 7: Virtualization and SAN Basics for DBAs

7

CPU Scheduling

Page 8: Virtualization and SAN Basics for DBAs

8

CPU Scheduling

Page 9: Virtualization and SAN Basics for DBAs

9

CPU Scheduling

Page 10: Virtualization and SAN Basics for DBAs

10

Not So Fast!

Page 11: Virtualization and SAN Basics for DBAs

11

Never Overallocate vCPUs• Less is More• Every Tick Matters• Minimize CPU Work• Don’t Be Strict

Photo Licensed with Creative Commons From http://www.flickr.com/photos/rsimpson/3832084595/

Page 12: Virtualization and SAN Basics for DBAs

12

So What About Memory?• Host: 64GB• Guest: 16GB• Other Guests: 32GB

Photo Licensed with Creative Commons From http://www.flickr.com/photos/erikthenorsk/3642116265/

Page 13: Virtualization and SAN Basics for DBAs

13

So What About Memory?• Host: 64GB• Guest: 16GB• Other Guests: 80GB

Photo Licensed with Creative Commons From http://www.flickr.com/photos/erikthenorsk/3642116265/

Page 14: Virtualization and SAN Basics for DBAs

14

How Hypervisors Cope• Host page file• Dedupe memory

(page sharing)• Keep guest OS

memory freed up• Learn more in

my bookmarks:http://delicious.com/brento/balloon

Photo Licensed with Creative Commons From http://www.flickr.com/photos/heartlover1717/208534358/

Page 15: Virtualization and SAN Basics for DBAs

15

Never Use Automatics• Set SQL Server’s

min/max memory• Set VMware’s

reservation size• Use locked pages

carefully

Photo Licensed with Creative Commons From http://www.flickr.com/photos/nataliejohnson/2419154951/

Page 16: Virtualization and SAN Basics for DBAs

16

Physical Storage Setup

Page 17: Virtualization and SAN Basics for DBAs

17

In Virtualization…

Page 18: Virtualization and SAN Basics for DBAs

18

Behind the Curtain

Page 19: Virtualization and SAN Basics for DBAs

19

Behind the Curtain

Page 20: Virtualization and SAN Basics for DBAs

20

Think You’re Alone?

Page 21: Virtualization and SAN Basics for DBAs

21

Never Assume VMs are Alone • Guests move• Guests get created• Competition:

virus scans, scheduled tasks, backups

Photo Licensed with Creative Commons From http://www.flickr.com/photos/32172473@N00/4036700968/

Page 22: Virtualization and SAN Basics for DBAs

22

Always Know Your Neighbors• Same disks• Same cache• Same controller• Same SAN• Ask:

– Usage pattern?– Scheduled jobs?– Antivirus?

Photo Licensed with Creative Commons From http://www.flickr.com/photos/searchnetmedia/4327761697/

Page 23: Virtualization and SAN Basics for DBAs

23

Design Storage as a Whole• Backup schedules• Backup methods• Backup targets• Use differentials• Stagger job times• Reconfigure antivirus

Page 24: Virtualization and SAN Basics for DBAs

24

Typical SAN Components• Drive enclosures• Controllers (& Cache)• Switch networks• Host Bus Adapters• HBA Drivers• Servers

Page 25: Virtualization and SAN Basics for DBAs

25

Lots of Paths for Data

Page 26: Virtualization and SAN Basics for DBAs

26

What Does Active/Active Mean?• One path per LUN• Sending vs receiving• Network design• Post-failover stickiness

Page 27: Virtualization and SAN Basics for DBAs

27

Got High Speed?

Page 28: Virtualization and SAN Basics for DBAs

28

So You Tested This Too, Right?

Photo Licensed with Creative Commons From http://www.flickr.com/photos/tophost/2247031208/

Page 29: Virtualization and SAN Basics for DBAs

29

Always Test First with SQLIO• Doesn’t use SQL Server• Doesn’t mimic SQL Server• Doesn’t return SQL metrics• Therefore: SAN guys love it!

Page 30: Virtualization and SAN Basics for DBAs

30

The Easy Way

Page 31: Virtualization and SAN Basics for DBAs

31

SQLIO ResultsE:\Program Files (x86)\SQLIO>sqlio -kW -t2 -s120 -dM -o1 -frandom -b64 -BH -LS Testfile.dat sqlio v1.5.SGusing system counter for latency timings, -1361967296 counts per second2 threads writing for 120 secs to file M:Testfile.dat

using 64KB random IOsenabling multiple I/Os per thread with 1 outstandingbuffering set to use hardware disk cache (but not file cache)

using current size: 24576 MB for file: M:Testfile.datinitialization doneCUMULATIVE DATA:throughput metrics:IOs/sec: 1539.50MBs/sec: 96.21latency metrics:Min_Latency(ms): 0Avg_Latency(ms): 0Max_Latency(ms): 572histogram:ms: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24+%: 66 32 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Page 32: Virtualization and SAN Basics for DBAs

32

Good Numbers, Bad News• iSCSI

– 1GB = 125 MB/sec– 10GB = 1250 MB/sec

• Fibre Channel:– 2GB = 250 MB/sec– 4GB = 500 MB/sec

Page 33: Virtualization and SAN Basics for DBAs

33

Which Causes An Outage?• New neighbors• RAID restripe• Drive failure• Cable change• Firmware change• Switch upgrade• Controller reboot

Photo Licensed with Creative Commons From http://www.flickr.com/photos/celebdu/10200825/

Page 34: Virtualization and SAN Basics for DBAs

34

Where Will You See Changes?• Windows event log• SQL Server logs• Profiler traces• Net Send popups• Your dreams at night

Page 35: Virtualization and SAN Basics for DBAs

35

Always Be Checking

Photo Licensed with Creative Commons From http://www.flickr.com/photos/buro9/298998173/

Page 36: Virtualization and SAN Basics for DBAs

36

My 3 Favorite Metrics• Physical Disk:

Avg Sec/Read and Write• System:

Processor Queue Length• SQL Server Memory:

Page Life Expectancy

Page 37: Virtualization and SAN Basics for DBAs

37

It’s Not All Bad News!• Easier scaling• Less firmware outages• No leased hardware cycles• Easier disaster recovery• Easier dinosaur handling

Page 38: Virtualization and SAN Basics for DBAs

38

Wrapping It Up• Virtualization Nevers:

– Overallocate vCPUs– Use automatics– Assume your VM is alone

• SAN Always’s:– Know your neighbors– Test first with SQLIO– Be checking

Page 39: Virtualization and SAN Basics for DBAs

39

http://www.BrentOzar.com/go/virtual

Page 40: Virtualization and SAN Basics for DBAs

40

Our Book• Internals:

– Memory– Locking– Storage

• Troubleshooting:– Perfmon/Profiler– RML Utilities– SQLNexus

Page 41: Virtualization and SAN Basics for DBAs

41

Our Authors• Christian Bolton

MVP, MCM, MCAFormer Microsoft PFE

• Justin LangfordFormer MS PFE

• Brent OzarMCM, MVP

• James Rowland-JonesMVP, EMC Consulting

• Steven WortMicrosoft Developer

Page 42: Virtualization and SAN Basics for DBAs

42

Paperbacks & PDF Versions:SQLServerTroubleshooting.com