You are on page 1of 37

SQL Server Best

Practices with Dell


Compellent
Doug Bernhardt
SQL Server Product Specialist

About me
Doug Bernhardt
With Dell Compellent for ~1.5 years
21 years experience in IT
18 years working with SQL Server
Administration, Development, Architecture

Responsible for SQL Server


Replay Manager
HA/DR

Agenda

Setup and Configuration


Data Instant Replay
SQL Server I/O
Flash Storage/SSD
Disaster Recovery

Setup and
Configuration

4
Confidential

Sizing for SQL Server


Appropriate sizing for SQL Server is often overlooked
No typical workload
Usage patterns vary even with vendor packages

Generalizations about OLTP or OLAP dont always apply


No two OLTP or OLAP environments are the same
Based on your business

Size for both performance and capacity


Tier 1 for Performance
All IOPS
20% of capacity

Tier 3 for Capacity


20% of IOPS
80% of capacity

Dont forget write penalty for RAID


Cost depends on RAID type
See SQL Server Best Practices Guide

Collecting performance data


Collect your own metrics
Tools
DPACK or Windows Performance Monitor (Perfmon)
Perfmon is more granular

Performance Metrics
IOPS
Disk Reads/Sec
Disk Writes/Sec
Disk Transfers/Sec

Throughput
Disk Read Bytes/Sec
Disk Write Bytes/Sec
Disk Bytes/Sec

Latency
Avg. Disk Sec/Read
Avg. Disk Sec/Write
Avg. Disk Sec/Transfer

Timing

Collect for 24 hrs. minimum


Busiest time
Performance sensitive time
Collect at 5 sec. intervals

Confidential

Storage Setup and Configuration


Single disk pool
Aggregate all I/O bandwidth
Easy to manage

Storage Profiles

Start with Recommended


Monitor
Create custom if needed

Consider Manageability vs. Flexibility


Hard to have both
Once you separate it may be hard to go back

Confidential

SQL Server Volume Recommendations


Performance
Requirements

File Type

Number of Volumes

User DB data

At least 1 per instance

Lower
performance may
be acceptable

Frequent, same schedule


as log volume

User DB log

1 per instance

High performance

Frequent, same schedule


as data volume

Data Root directory


(system DBs)

1 per instance

Lower
performance

Infrequent Replays,
independent schedule

Tempdb data and log

1 per instance

High performance
may be required

No Replays

Native SQL Backup

1 per instance

Lower
performance may
be acceptable

Replays optional,
independent schedule

Customization Factors

Replication
Virtualization
Performance
Replay Schedules

Confidential

Replay Requirements

Server Setup and Configuration


Format volumes using 64K Allocation Unit
Round Robin is suggested MPIO policy
HBAs
Latest version of firmware and drivers
Verify queue depth settings

iSCSI

Min 1GBit Ethernet recommended


10Gbit suggested
Separate network
MS iSCSI Initiator
SQL dependant on iSCSI Initiator service
Dedicated NICs
Create connections manually rather than Quick Connect

Confidential

Other Performance Considerations


Multiple data files per filegroup

SQL Server will stripe I/O across files


All files should be same size
Flexibility to place database on multiple volumes
Spread volumes across multiple controllers

Same storage center or even multiple storage centers!!!

Dedicated volumes for single database allow more control


Maximize cache utilization in database server

10

Confidential

Storage Validation
Numerous components so validation is important!
Desired outcomes
System meets performance needs
System matches design
No unexpected errors

SQLIO and Iometer are popular tools


Be careful of zero filled test files
Use correct parameters for test type

SQLIOSim is NOT intended for performance testing


Suitability not performance

Validate path and disks separately


Help isolate any issues
Different test parameters

11

Confidential

Path Validation
Goal is to only validate path to the storage center
Use one volume per controller
Format volume with 64KB allocation unit
SQLIO Large Block Sequential Read

12

10MB file per volume


8 threads total
Sequential read 512KB block size, 32 outstanding I/Os
Run for 2 min

Confidential

Disk Validation
Once paths are validated, now test system performance
SQLIO or Iometer tips
Use 100GB file or larger
Test I/O sizes observed in your environment

Use one volume per controller


Pre-allocate the volumes and discard after testing

Interpreting results

Do the math, do results match the design?


Run multiple tests, are results consistent?
Review error logs for unexpected messages

13

Confidential

Data Instant
Replay

14
Confidential

Data Instant Replay


Take advantage of Replays!!!

Fast, taken in seconds or less


Space efficient
No overhead on database server
Frequent backups of large databases are possible!

Daily replays are recommended


Recovery
Assist Data Progression
Replication

Replays are taken on entire volume


Databases with different replay schedules can be placed on separate volumes
Large and/or active databases on separate volumes

Replays may augment rather than replace an existing backup strategy

15

Confidential

Replay Manager
Replay Manager is recommended for SQL Server
Use Replay Manager for database consistent backups
Consistency provided thru VSS Integration to SQL Server

Writes are frozen DO NOT BE AFRAID!!!


Dirty pages flushed to disk (checkpoint)
Backup metadata tables in MSDB are updated
Backup is recorded in error log

Use Replay Manager with log backups for arbitrary point in time recovery.

Simple interface

Database centric rather than storage centric


Storage background not required
PowerShell support

16

Confidential

Replay Manager Tips


Consider placing databases for backup sets on separate volumes
Create fast and space efficient database copies
Storage Administrators and DBAs can work together!
Provide DBAs access and awareness of Replay Manager
Data protection and space efficiency require communication

If Replay Manager is not used, use a Consistency Group


No replays on Tempdb

17

Confidential

SQL Server
I/O

18

Why is SQL Server I/O challenging?


Applications can be extremely latency sensitive
Largest latency component of SQL Server transactions is typically I/O
Business transactions typically require multiple queries
Each query generates multiple I/O
Latency for each I/O adds up quickly

User can be waiting for search, lookup, auto fill, etc.

SQL Server can be I/O intensive

A single SQL Instance can overwhelm a large storage system


Simple queries and/or commands can have huge impact
Capable of lots of small block random I/O

I/O mix varies greatly


Size ranges from 512B-1MB
Read/write mix and random vs. sequential
Numerous factors

19

Confidential

SQL Server I/O factors


SQL Server architecture and features
Application features and usage
Maintenance activity
Operation

Random/Sequential

Read/Write

Size Range

OLTP Log

Sequential

Write

512 bytes-64KB

OLTP Data

Random

Read/Write

8KB

Read Ahead

Sequential

Read

8KB-256KB

Backup

Sequential

Read/Write

1MB

DBCC CHECKDB

Sequential

Read

8KB-64KB

Source: http://blogs.msdn.com/b/sqlcat/archive/2005/11/17/493944.aspx

20

Confidential

Reducing SQL Server I/O


Why?
Performance
Scalability
Cost

How?
Memory
SQL Server uses most memory for buffer pool (cache)
All I/O goes through buffer pool

Database Compression
Reduce the amount of data
CPU cost varies

Instant File Initialization


Eliminates unnecessary I/O
Data files only
Occurs at inconvenient times

Design

21

Database
Query
Application
Maintenance

Confidential

High
Performance
SQL Server

22

High Performance SQL Server


For most applications spinning disk is fine
Some SQL Server applications can be very demanding
Latency sensitive
High bandwidth
Heavy write

Flash Storage (SSD) MAY be the solution.it depends

23

Confidential

Storage Center All Flash Array


New in Storage Center 6.4
Combination of write intensive SSD and read intensive SSD
Tier 1 write intensive SSD
Tier 2 read intensive SSD
Can also add spinning disk as Tier 3 for hybrid system!

Reference Architecture -High Performance SQL Server with Storage Center


6.4 All Flash Array
http://en.community.dell.com/techcenter/extras/m/white_papers/20438061
.aspx
Test Scenario

24

OLTP workload
2TB Database SQL Server 2012
16Gb Fibre Channel end to end
2 Dell R820 Servers (application, database)
Compared 3 storage configurations

Confidential

All Flash Test Comparison

25

Confidential

All Flash Array Transactions per Second

26

Confidential

All Flash Array - IOPS

27

Confidential

All Flash Array - Latency

28

Confidential

All Flash Testing -Takeaways

Latency makes all the difference


Doubling the number of spinning drives did not double performance
All Flash is a great solution for the most demanding I/O workloads
Once SSD is in place, look for bottlenecks elsewhere
Server CPU
Storage network bandwidth

Other benefits as well


Power
Cooling
Space

Affordable Flash at the price of spinning disk

29

Confidential

Disaster
Recovery

30

Disaster Recovery
What are the requirements?
Know your requirements and challenge five nines
As you add nines cost increases exponentially
People, Process, Technology

Replication
Asynchronous
Replicate Active Replay can provide near real-time

Synchronous
High Consistency
Zero data loss

High Availability
Functions like High Consistency until an interruption occurs

Consider latency

Simulate Replication
Assess bandwidth requirements
Convert into live replication

31

Confidential

SQL Server Replication Strategies


Choose what to replicate
Database volumes only

Database level protection


Reduced replication footprint
Dedicated destination server not required
Need process to sync data not stored in user databases
May require additional config at failover time

All volumes (including boot volume)

Server level protection


Entire server is protected
Standby is exact copy of primary
Requires dedicated server
Larger replication footprint

Use Replay Manager to take Replays of database volumes

32

Confidential

SQL Server Optimizations for Replication


Data Compression
Less data to replicate
CPU overhead for SQL Server

Application and database tuning


Minimize data to replicate

File Layout

Only databases being replicated should be on replicated volumes

TempDB
No need to replicate
SORT_IN_TEMPDB option

33

Confidential

PowerShell
Most UI features available as PowerShell cmdlets
Over 140 cmdlets for Storage Center and Replay Manager

34

Customize SQL Server Integration


Automate disaster recovery activities
Environment builds
Refresh test/QA environments

Confidential

Summary
Covered various tips around

Setup and Configuration


Replays
SQL Server I/O
Disaster Recovery

Think about how these apply to your environment


Consider All Flash Array for performance demanding applications

35

Confidential

Questions?
Contact Info
Doug_Bernhardt@dell.com

DellTechCenter.com
Compellent Technical Content
http://en.community.dell.com/techcenter/storage/w/wiki/5018.compellenttechnical-content.aspx

SQL Server Best Practices

http://en.community.dell.com/techcenter/extras/m/white_papers/20438053.aspx

All Flash Array


http://en.community.dell.com/techcenter/extras/m/white_papers/20438061.aspx

Customer Portal

Customer.Compellent.com

Support

support@Compellent.com
1-866-EZSTORE

36

Confidential

37

Confidential

You might also like