Gary Hope SQL Guy Michael O’Donovan SharePoint Guy
Expectations Every deployment is different Size Usage Patterns Fundamental understanding What you should be looking for Tools and techniques to help
Agenda SharePoint architecture basics Which SharePoint databases should concern me Hardware selection basics SharePoint database optimisation Monitoring my SQL Server(s)
SharePoint Architecture (simplified) ASP.NET Web Server with SQL Databases All content lives in SQL Databases
Key Concepts Web Application (IIS Site extended with WSS) Site Collection Site List List Item
Tour around SharePoint Create a new content database
Performance Hot Spots Indexing Process Profile Import Timer Jobs (user sync from profile to user info) STSADM Backup & Restore Large 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 Temp Master Model Tlogs
SQL Hardware Selection x64 Windows and x64 SQL Only x64 support in future versions Loads of RAM for SQL 4GB … 16GB (why more memory) Choosing server class hardware Scaling out always an option with SharePoint
Database Configuration Data File Characteristic: TLOG = Sequential Write IO DATA = Random Read and Write IO Separate TLog and Data onto separate Disks Separate Databases onto separate Disks
Disk I/O Optimization Partition Alignment Behavior prior to Windows Server 2008 create partition primary align= format fs=ntfs unit=64K label=" " nowait Chose RAID Configuration appropriately Configure SAN appropriately
SharePoint DBs Content Max Size 100GB Site Collections / Database Use RAID 5 for data (or even better RAID 10) Use RAID 10 for logs Usage is highly variable based on SharePoint usage Search Use RAID 10 logical units Usage is extremely read/write intensive
SQL Server TempDB Create additional secondary files of equal size Optimal 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 usage Trace Flag -T1118
SQL Log and Data Locations Multiple Files for TempDB
SharePoint Database Admin Tasks Backup (and Restore) SQL Native Database and Log Backups System Center Data Protection Manager Database Consistency Checking DBCC CheckDB Index Maintenance ALTER INDEX REBUILD Managing Performance
Fragmentation Kills Performance Types of fragmentation Data file - Specify appropriate file size Log file – Specify appropriate file size Index – REORGANIZE or REBUILD ALTER 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 test Typical 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 Length Not the best measure in my opinion, compare to baseline Average Disk bytes/sec/Read and bytes/sec/Write Use sys.dm_io_virtual_file_stats to monitor files
Set initial size of database (auto grow) Fragmentation of IW content database Excel View of Database IO
Performance Testing & Tools Stress Testing SQLIO Visual Studio Sptdatapop (codeplex) Performance Monitoring Tools Performance Monitor SQL Performance Data Warehouse System Center Operations Manager
Using Database Aliases Allow content database to be moved to other instances with no config changes in SharePoint Can use DNS changes to “move” DBs to alternative instance in the case of database mirroring
What not to do Don’t do anything else with these dBs No new indexes No new tables No stored procedure changes Couple of well known exceptions Moving tables to filegroups to separate IO 8/09/16/sql-file-groups-and-search.aspx
Newer SQL and SharePoint Versions SharePoint 2010 x64 Only SQL Only SQL 2008 benefits Backup Compression Transparent Database Encryption Database Mirroring Enhancement Policy Based Administration Performance Data Warehouse
5 Things to Take-Away SharePoint Database Characteristics How to monitor them in your world Log and Data file locations for SharePoint DBs Windows Server 2003 misalignment Fragmentation Set initial size of database files (auto grow)
White Papers Capacity Planning for Search Performance Recommendations Database Maintenance for SharePoint Working with large lists in Office SharePoint Server 2007
Related Content Breakout Sessions (session codes and titles) Whiteboard Sessions (session codes and titles) Hands-on Labs (session codes and titles) Required Slide Speakers, please list the Breakout Sessions, TLC Interactive Theaters and Labs that are related to your session. Any queries, please check with your Track Owner. Required Slide Speakers, please list the Breakout Sessions, TLC Interactive Theaters and Labs that are related to your session. Any queries, please check with your Track Owner.
Required Slide Complete a session evaluation and enter to win! 10 pairs of MP3 sunglasses to be won
International Content & Community Resources for IT Professionals Resources for Developers Microsoft Certification & Training Resources Resources Required Slide Speakers, TechEd 2009 is not producing a DVD. Please announce that attendees can access session recordings from Tech-Ed website. These will only be available after the event. Required Slide Speakers, TechEd 2009 is not producing a DVD. Please announce that attendees can access session recordings from Tech-Ed website. These will only be available after the event. Tech ·Ed Africa 2009 sessions will be made available for download the week after the event from:
© 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. Required Slide
SharePoint Design Tips How many application pools? Each application pool takes RAM (1 – 2GB) Ensure “Max Used Memory” setting utilizes all the available RAM in your WFE’s. Maximum Items in a list (is 2000 true?) Whitepaper: Working with large lists in Office SharePoint Server Others Site collections per web application Site collections per database Sites per site collection