gary hope sql guy michael o’donovan sharepoint guy
TRANSCRIPT
Gary HopeSQL Guy
Michael O’DonovanSharePoint Guy
Expectations
Every deployment is differentSizeUsage Patterns
Fundamental understandingWhat you should be looking forTools and techniques to help
Agenda
SharePoint architecture basicsWhich SharePoint databases should concern meHardware selection basicsSharePoint database optimisationMonitoring my SQL Server(s)
SharePoint Architecture (simplified)
ASP .NET Web Server with SQL DatabasesAll content lives in SQL Databases
Key Concepts
Web Application (IIS Site extended with WSS)Site CollectionSiteListList Item
Tour around SharePointCreate a new content database
Performance Hot Spots
Indexing ProcessProfile ImportTimer Jobs (user sync from profile to user info)STSADM Backup & RestoreLarge List Operations
Which database has most disk IO demand?
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
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
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
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
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
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
SQL Log and Data LocationsMultiple Files for TempDB
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
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%)
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
Set initial size of database (auto grow)Fragmentation of IW content databaseExcel View of Database IO
Performance Testing & ToolsStress Testing
SQLIOVisual StudioSptdatapop (codeplex)
Performance Monitoring Tools
Performance MonitorSQL Performance Data WarehouseSystem Center Operations Manager
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
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
Newer SQL and SharePoint Versions
SharePoint 2010x64 OnlySQL 2005+ Only
SQL 2008 benefits Backup CompressionTransparent Database EncryptionDatabase Mirroring EnhancementPolicy Based AdministrationPerformance Data Warehouse
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)
White Papers
Capacity Planning for SearchPerformance RecommendationsDatabase Maintenance for SharePointWorking with large lists in Office SharePoint Server 2007
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)
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
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
© 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.