Upload
knut-relbe-moe-mvp-mct
View
291
Download
2
Embed Size (px)
Citation preview
Getting SQL Spinning with SharePoint – Best Practices for the Back EndKnut Relbe-MoeOffice 365 MVPChief Technical Architect
Knut Relbe-Moe
My Experience: SharePoint evangelist, mentor, speaker Old developer, turned Architect / ITPro Have worked with SharePoint since the 2003 version. Worked with several clients upgrading their solution from 2007/2010 to 2013. Works as a Lead Architect and advisor creating SharePoint Farm
architecture/infrastructure on many projects. With up to 25.000 users. Worked with automating the installation and configuration of SharePoint.
Chief Technical ArchitectKnowledge Factory, Oslo, NorwayOffice 365 MVPMigration ExpertEducator for GlasspaperNintex Virtual Technical Evangelist
http://www.sharepointblog.no @shareptkarm +47 982 24 609
MS SQL Server is like the brain of your SharePoint environment
So if the brain works slow, everything else will be slow….
• Follow the guidelines in this presentation• Read and understand this whitepaper from Vlad
Catrienscu• Maximizing SQL 2012 Performance for SharePoint 2013
WhitePaper
• If you have to reinstall MS SQL server as a new instance with the correct settings.
How to fix this
Tip 1
• Physical SQL Server will always outperform a virtual SQL server with the same specs, but what shall you choose.• Pros :
• High availability because of the hypervisor, not because of clustering
• Easier to scale up & down• Can be easier to recover at Disaster Recovery
• Cons:• Very heavily loaded VMs have seen disk I/O issues• Over allocation of a virtual host. If you have too much running on a
host, it's not just I/O that could be impacted.• Harder to protect
Physical vs Virtual
Tip 2
• You should invest in as fast disk as possible• If you run on a Virtual Server, consider physical disks for the
SQL server• SSD or SAN• If you have physical SQL server you should use at least 6
Disks:1. TempDB 2. TempDB Logs 3. SharePoint Databases 4. SharePoint Databases Logs 5. OS 6. SQL binaries and other application Installs
DISKS
• You have a farm where most of the content is only read and downloaded
• Your users will be collaborating, uploading documents, content
Speed/Scenario Read Intensive Scenario (ex Public Website) Fastest Tempdb data files and transaction logs
. Database data files
. Search databases, except for the Search administration database
Slowest Database transaction log files
DISKS
Speed/Scenario Write Intensive Scenario ( collaborative workspace) Fastest Tempdb data files and transaction logs . Database transaction log files . Search databases, except for the Search administration database
Slowest Database data files
Tip 3
• Your SQL Server needs to have enough RAM to function properly. • If your SQL Server runs only SharePoint, here are the
minimum requirements
Small Farm Deployment (0-500GB of Data)
Medium Farm Deployment (501-1TB of data)
Large Farm Deployment (1-2TB of Data)
Very Large Farm Deployment (2-5 TB of Data)
Special Cases
Ram Required 8GB 16GB 32 GB 64GB 64GB+ CPU 4 4 8 8 8
RAM & CPU
Tip 4
• SQL server reads and writes 64k at a time• So change your allocation size from the 4K default to
64K.• This small change alone, will improve your SQL
performance by up to 30%
NTFS Allocation size
Tip 5
Server Configuration – Collation
• SharePoint server 2013 is built to use Latin1_General_CI_AS_KS_WS. This is a quote from Microsoft to prove it:• “We support any CI collation for the SQL instance (for master, tempdb
databases). However we recommend using Latin1_General_CI_AS_KS_WS as the instance default collation (master, tempdb databases).” • CI – (Case Insensitive) A and a ARE treated as the same character. • AS – (Accent Sensitive) a and á are NOT treated as the same character. • KS – (Kana Sensitive) Japanese Hirakana and Katakana characters which look the
same are NOT treated as the same character. • WS – (Width Sensitive) Single-Byte and Double-Byte versions of the same
character are NOT treated as the same character.
Tip 6
Max Memory
SQL Server (and other database systems such as Oracle and Sybase) need to read data pages into their internal memory before they can be used. Of course your server needs memory to operate as well. When your database engine and your server are competing for the same memory resources, you get bad performance. You want your server and your database engine to be like dancing partners, and less like my kids fighting over the last cupcake.
Thomas Larock from SQL Rockstar explains this:
Tip 7
Optimize TempdB
• Split across n locations• N = total number of physical cores > super myth
• 25% of largest content dB• The fastest disk possible
Tip 8
Default fill factor to 80
“SharePoint, a server wide setting of 80 is optimal to support growth and minimize fragmentation.”
Tip 9
Model Database
• SQL Server uses the Model database as a template for creating new user databases• So therefor make sure that Model database have correct initial size
and growth settings.• The log should be around 25% of the initial size.• The auto growth is your insurance policy if your current database size has
been reached.
Script
Tip 10
Auto Create Statistics
• Do not enable auto-create statistics on a server that hosts SQL Server and SharePoint Server• Enabling auto-create statistics is not supported for SharePoint Server
Tip 11
USE “DBA” created databases
• Sizing• Autogrowth• DO NOT USE SIMPLE RECOVERY• Unless you understand the implications
Tip 12
Maintenance Plan
• Create a maintenance plan to backup databases, rebuild indexes and checking the logical and physical integrity of your database• Make sure you don’t run backup when heavy timer jobs runs in the
SharePoint environment, like midnight
Tip 13
Script your SQL Server installation
• https://sqlserverfinebuild.codeplex.com/
Tip 14
Always install SQL Alias in SharePoint
Summary
10 simple tips to maximize performance
http://www.sharepointblog.no/?p=851. SSD Disk or better2. Formating disk with 64K3. Language corralation Latin_CI_AS_KS_WS4. Maximum memory5. Changed Sizes on Model database6. Default fill factor to 807. Switched of autocreate statistics8. Max Degree of Parallelism – set to 1 (it has to be)9. Changed Initial Size & Autogrow on temp database, and created extra temp files for the amount
of processors.10. Don’t do backups at midnight.Maximizing SQL 2012 Performance for SharePoint 2013 WhitePaper by Vlad Catrinescu
@shareptkarmOffice 365
Questions?
Thank You!Knut Relbe-MoeChief Technical [email protected]@outlook.com