33

Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

Embed Size (px)

Citation preview

Page 1: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy
Page 2: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

Gary HopeSQL Guy

Michael O’DonovanSharePoint Guy

Page 3: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

Expectations

Every deployment is differentSizeUsage Patterns

Fundamental understandingWhat you should be looking forTools and techniques to help

Page 4: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

Agenda

SharePoint architecture basicsWhich SharePoint databases should concern meHardware selection basicsSharePoint database optimisationMonitoring my SQL Server(s)

Page 5: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

SharePoint Architecture (simplified)

ASP .NET Web Server with SQL DatabasesAll content lives in SQL Databases

Page 6: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy
Page 7: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

Key Concepts

Web Application (IIS Site extended with WSS)Site CollectionSiteListList Item

Page 8: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy
Page 9: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

Tour around SharePointCreate a new content database

Page 10: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

Performance Hot Spots

Indexing ProcessProfile ImportTimer Jobs (user sync from profile to user info)STSADM Backup & RestoreLarge List Operations

Page 11: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

Which database has most disk IO demand?

Page 12: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

Database Disk IO Demand

SearchSearch

Most Demand

ConfigConfig

Medium Demand

+SSP+SSP

*Content..*Content..

Low Demand

* Except during backup and Indexing + Except during Profile Import

TempTemp

MasterMaster

ModelModel

TlogsTlogs

Page 13: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

SQL Hardware Selection

x64 Windows and x64 SQLOnly x64 support in future versions

Loads of RAM for SQL4GB … 16GB (why more memory)Choosing server class hardware

Scaling out always an option with SharePoint

Page 14: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

Database Configuration

Data File Characteristic:TLOG = Sequential Write IODATA = Random Read and Write IO

Separate TLog and Data onto separate DisksSeparate Databases onto separate Disks

Page 15: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

Disk I/O Optimization

Partition AlignmentBehavior prior to Windows Server 2008

create partition primary align=<Offset_in_KB>format fs=ntfs unit=64K label="<label>" nowait

Chose RAID Configuration appropriately Configure SAN appropriately

Page 16: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

SharePoint DBs

Content Max Size 100GBSite Collections / DatabaseUse RAID 5 for data (or even better RAID 10)Use RAID 10 for logs

Usage is highly variable based on SharePoint usage

SearchUse RAID 10 logical units

Usage is extremely read/write intensive

Page 17: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

SQL Server TempDB

Create additional secondary files of equal sizeOptimal TempDB data file sizes can be calculated using the following formula:

[MAX DB SIZE (KB)] X [.25] / [# CORES] = DATA FILE SIZE (KB)

Rule of thumb: Calculation result (starting size) should be roughly equal to 25% of the largest content or search DB.Best managed by monitoring usageTrace Flag -T1118

Page 18: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

SQL Log and Data LocationsMultiple Files for TempDB

Page 19: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

SharePoint Database Admin Tasks

Backup (and Restore)SQL Native Database and Log BackupsSystem Center Data Protection Manager

Database Consistency CheckingDBCC CheckDB

Index MaintenanceALTER INDEX REBUILD

Managing Performance

Page 20: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

Fragmentation Kills Performance

Types of fragmentationData file - Specify appropriate file sizeLog file – Specify appropriate file size

Index – REORGANIZE or REBUILDALTER INDEX REORGANIZE (> 5% and < = 30%)ALTER INDEX REBUILD (> 30%)

Page 21: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

I/O Performance Measurement

Performance Monitor Counters to watch:Disk Read/sec and Write/sec

Compared with maximum achieved during testTypical systems will perform 100+ per spindle

Average Disk sec/Read and sec/Write< 5ms for log writes and <20 for data writes good> 100ms you will have a performance problem

Average Disk Queue LengthNot the best measure in my opinion, compare to baseline

Average Disk bytes/sec/Read and bytes/sec/WriteUse sys.dm_io_virtual_file_stats to monitor files

Page 22: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

Set initial size of database (auto grow)Fragmentation of IW content databaseExcel View of Database IO

Page 23: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

Performance Testing & ToolsStress Testing

SQLIOVisual StudioSptdatapop (codeplex)

Performance Monitoring Tools

Performance MonitorSQL Performance Data WarehouseSystem Center Operations Manager

Page 24: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

Using Database Aliases

Allow content database to be moved to other instances with no config changes in SharePointCan use DNS changes to “move” DBs to alternative instance in the case of database mirroring

SQL Server Client Alias

DNS Lookup

Instance Name Resolution

SQL 2005 or 2008 Browser Service

Windows DNS Service

CNAME Record

A Record

Connect to SQL àSQL 2005 or 2008 Database Service

SQL Server Name = SQL Server NameSQL Server Name = Host Name, PortSQL Server Name = IP, Port

If port unknown then lookup instance using SQL Server Browser Service

If IP unknown then lookup hostname using Windows DNS Service

1

2

3

4

Page 25: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

What not to do

Don’t do anything else with these dBsNo new indexesNo new tablesNo stored procedure changes

Couple of well known exceptionsMoving tables to filegroups to separate IO

http://blogs.msdn.com/enterprisesearch/archive/2008/09/16/sql-file-groups-and-search.aspx

Page 26: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

Newer SQL and SharePoint Versions

SharePoint 2010x64 OnlySQL 2005+ Only

SQL 2008 benefits Backup CompressionTransparent Database EncryptionDatabase Mirroring EnhancementPolicy Based AdministrationPerformance Data Warehouse

Page 27: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

5 Things to Take-Away

SharePoint Database CharacteristicsHow to monitor them in your world

Log and Data file locations for SharePoint DBsWindows Server 2003 misalignmentFragmentationSet initial size of database files (auto grow)

Page 28: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

White Papers

Capacity Planning for SearchPerformance RecommendationsDatabase Maintenance for SharePointWorking with large lists in Office SharePoint Server 2007

Page 29: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

Related Content

Breakout Sessions (session codes and titles)Breakout Sessions (session codes and titles)

Whiteboard Sessions (session codes and titles)Whiteboard Sessions (session codes and titles)

Hands-on Labs (session codes and titles)Hands-on Labs (session codes and titles)

Page 30: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

Complete a Complete a session session evaluation and evaluation and enter to win!enter to win!

10 pairs of MP3 10 pairs of MP3 sunglasses to be wonsunglasses to be won

Page 31: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy
Page 32: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

www.microsoft.com/teched

International Content & Community

http://microsoft.com/technet

Resources for IT Professionals

http://microsoft.com/msdn

Resources for Developers

www.microsoft.com/learning

Microsoft Certification & Training Resources

Resources Tech·Ed Africa 2009 sessions will be made available for download the week after the event from: www.tech-ed.co.za

Page 33: Gary Hope SQL Guy Michael O’Donovan SharePoint Guy

© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS,

IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.