sql saturday powerpoint dc_san

37
SAN Basics for DBAs Joey D’Antoni November 5, 2011

Upload: jdanton

Post on 27-Jan-2015

113 views

Category:

Technology


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Sql saturday powerpoint dc_san

SAN Basics for DBAs

Joey D’Antoni

November 5, 2011

Page 2: Sql saturday powerpoint dc_san

About Me

Senior SQL Server DBA at Comcast Blog: joedantoni.wordpress.com Twitter @jdanton Email [email protected]

11/4/2011 |

Footer Goes Here2 |

Page 3: Sql saturday powerpoint dc_san

Storage

Understanding Storage Types A little bit about SSDs RAID Levels Components of a SAN SAN Benefits SANs and DR Summary

Page 4: Sql saturday powerpoint dc_san

Storage

Page 5: Sql saturday powerpoint dc_san

Different Kind of Storage

Page 6: Sql saturday powerpoint dc_san

Hard Drive Components

Page 7: Sql saturday powerpoint dc_san

Caching

Almost all hard drives (SAN, standalone) have some form of caching (RAM in front of storage)

For SQL Servers—make sure you have a battery backed cache—if you don’t and power fails—you will lose data!

Page 8: Sql saturday powerpoint dc_san

Why is storage the bottleneck?

Page 9: Sql saturday powerpoint dc_san

Disk Drives

Hard Drives can only spin at 15,000 RPM. Hard Drive Performance has improved

approximately 50x Have grown in capacity During the performance improvement CPU

speed increase 5521x

Page 10: Sql saturday powerpoint dc_san

Latency

“Disk latency is around 13ms, but it depends on the quality and rotational speed of the hard drive. RAM latency is around 83 nanoseconds. How big is the difference?

If RAM was an F-18 Hornet with a max speed of 1,190 mph (more than 1.5x the speed of sound), disk access speed is a banana slug with a top speed of 0.007 mph.”

--credit Christian Paredes Blue Box Group

Page 11: Sql saturday powerpoint dc_san

CPU and Disks

As CPUs have gotten faster they have the ability to drive more IOPs.

Modern CPUs are so powerful they can saturate a 10 GB connection with I/O requests—your disks can’t possibly keep up

Page 12: Sql saturday powerpoint dc_san

SSDs (Solid State Drives)

Page 13: Sql saturday powerpoint dc_san

SSDs are Fast

Much faster on random reads and writes At least 5x better performance, often much more Up to 350x faster on seeks

Not nearly as much of difference on sequential reads and writes

Page 14: Sql saturday powerpoint dc_san

SSDs are Expensive

List Prices From Fusion-IO160GB SLC ioDrive - $8495

320GB SLC ioDrive - $15495

320GB MLC ioDrive - $7495

640GB MLC ioDrive - $11495

 

320GB SLC ioDrive Duo – 16,990

640GB SLC ioDrive Duo - $30,990

640GB MLC ioDrive Duo - $14,990

1.28TB MLC ioDrive Duo - $22,990

These are really great for TempDB

Page 15: Sql saturday powerpoint dc_san

RAID

RAID—Redundant Array of Independent Disks

Hard Drives Will Fail, RAID is what gives you protection from that

Page 16: Sql saturday powerpoint dc_san

RAID 0

Page 17: Sql saturday powerpoint dc_san

RAID 0, Don’t Do This

From a major virtualization vendor benchmark

Page 18: Sql saturday powerpoint dc_san

RAID 0

No data protection at all

Best performance If you lose one disk,

you lose it all As you add disks

risk increases

Page 19: Sql saturday powerpoint dc_san

RAID 1--Mirroring

Mirroring No increase in

write performance Read

performance is increased

50% Capacity Loss

Page 20: Sql saturday powerpoint dc_san

RAID 5—Striping (What you SAN Admin Wants)

Maximum Capacity Big Write Penalty—

gets worse as more disks are added

Not good for highly transaction databases

BAARF

Page 21: Sql saturday powerpoint dc_san

RAID 1+0 (10) Mirrored Striping

Best performance Requires 4 or more

drives Only 50% of actual

capacity is used

Page 22: Sql saturday powerpoint dc_san

Summary of RAID Levels

Ask for RAID 10 for Everything (you won’t get it)

Make sure your TempDB and Logs are on RAID 10

NEVER USE RAID 0!!!

Page 23: Sql saturday powerpoint dc_san

Storage Area Network

Page 24: Sql saturday powerpoint dc_san

What is a SAN?

Basically a specialized computer for storage Computer, Switches and Hard Drives Not a performance device Can be used for redundancy and DR

purposes Will serve many servers—so critical piece of

your infrastructure

Page 25: Sql saturday powerpoint dc_san

SAN Components

HBA (Fibre) Card—Connects your server to SAN via Fiber Optic cable

iSCSI Card—Ethernet Card connecting server to SAN

Switch—Either fibre or ethernet switch connecting server to SAN

SAN head unit—Controls processing, RAID levels

Disk Array—The physical array behind your SAN (a bunch of hard drives)

Page 26: Sql saturday powerpoint dc_san

iSCSI vs Fibre Channel

iSCSI is cheaper, and in smaller shops your network admin can manage the switches

Over 10G Ethernet iSCSI is faster, but that is still uncommon

Fiber is more susceptible to breakage, but currently more common

Fibre is faster, generally Note—all SAN components must be the same

speed, or network traffic reverts to slowest in chain

Page 27: Sql saturday powerpoint dc_san

Multi-Pathing

How your SAN admin sleeps at night!

Make sure your databases servers are multi-pathed

Page 28: Sql saturday powerpoint dc_san

SAN Benefits

Expand Capacity easily and on the fly High availability Disaster Recovery

Page 29: Sql saturday powerpoint dc_san

SANs and DR

WARNING!—Don’t try this unless you have a real budget and a good SAN admin

Most SANs vendors have as an option SAN replication

Allows for multi-site failover Multi-site clustering fully supported in SQL

Server 2012 Expensive—requires fiber connection

between sites and expensive software

Page 30: Sql saturday powerpoint dc_san

SAN Terms

LUN—Logical Unit Number, but in practical terms, what your SAN admin will call a disk that he presents to your server

Fibre Channel—Fiber Optic connection to SAN

HBA Card—Card that plugs into your server to connect it to the SAN

IOPs—I/O Operations Per Second—the way your SAN admin measures performance

Page 31: Sql saturday powerpoint dc_san

SANs and SQL Server—What to ask for

TempDB absolutely needs its own disk (and you should have multiple TempDB files)

Logs should be on a separate disk from data files

Ideally separate system and user DBs If shared instance, put split high utilization

DBs onto separate disk devices

Page 32: Sql saturday powerpoint dc_san

Shared Environment vs Dedicated Environment

Page 33: Sql saturday powerpoint dc_san

SANs are Multi-Tenant

You don’t want to share disks with the Exchange server

File servers are a decent partner for database servers

Page 34: Sql saturday powerpoint dc_san

Test Your SAN

Good free tools available like SQLIO Never run this on a production server (and

warn your SAN admin)

Page 35: Sql saturday powerpoint dc_san

Summary

RAID 0 is bad Hard Drives will always be the bottleneck Be nice to your SAN admin—ask for RAID 10 Split your SQL files across many disks SSDs are fast, but pricey

Page 36: Sql saturday powerpoint dc_san

Questions?

Page 37: Sql saturday powerpoint dc_san

Contact Info

Twitter: @jdanton Email: [email protected] Blog (slides): joedantoni.wordpress.com