+ All Categories
Home > Software > Optimize SQL server performance for SharePoint

Optimize SQL server performance for SharePoint

Date post: 21-Jan-2018
Category:
Upload: serge-luca
View: 132 times
Download: 2 times
Share this document with a friend
51
SharePoint Saturday Montreal #SPSMontreal May 13 th 2017 SharePoint Saturday Montreal Rendre son SharePoint 2013/2016 extrêmement rapide en monitorant & optimisant SQL Server Serge Luca & Isabelle Van Campenhoudt ShareQL
Transcript
Page 1: Optimize SQL server performance for SharePoint

SharePoint Saturday Montreal#SPSMontreal

May 13th 2017

SharePoint Saturday

Montreal

Rendre son SharePoint 2013/2016 extrêmement rapide en monitorant & optimisant SQL ServerSerge Luca & Isabelle Van Campenhoudt

ShareQL

Page 2: Optimize SQL server performance for SharePoint

SharePoint Saturday Montreal#SPSMontreal

Go

ld

Bro

nze

Thanks to our sponsors !

Page 3: Optimize SQL server performance for SharePoint

Isabelle Van Campenhoudt

Isabelle Van

Campenhoud

t

SQL Server MVP, Brussels

Consultant, speaker, trainer, PASS V-Chapter Leader

Managing partner de www.ShareQL.com

SQL Server since 1999

Blog: http://thesqlgrrrl.wordpress.com/

[email protected]

@thesqlgrrrl

Isabelle Van Campenhoudt

globalfrench.sqlpass.org

Page 4: Optimize SQL server performance for SharePoint

Serge Luca

Serge Luca

10 x SharePoint MVP, Brussels

Consultant, speaker, trainer

Managing partner of www.ShareQL.com

SharePoint since 2001

Blog: http://sergeluca.wordpress.com/

[email protected]

@SergeLuca

Serge Luca

Page 5: Optimize SQL server performance for SharePoint

Credits

Serge Luca

Accidental DBA

IsabelleVan Campenhoudt

SQL guru

Page 6: Optimize SQL server performance for SharePoint

Basic SharePoint DB concepts

Operating System settings

SQL Server configuration

Databases configuration

SharePoint and SQL Server integration concepts

SQL Server optimization

HA and DR : Always On Availability Groups & SP 2013

Page 7: Optimize SQL server performance for SharePoint

Basic SharePoint DB concepts

Operating System settings

SQL Server configuration

Databases configuration

SharePoint and SQL Server integration concepts

SQL Server optimization

HA and DR : Always On Availability Groups & SP 2013

Page 8: Optimize SQL server performance for SharePoint

99.9% of SharePoint content stored in SQL Server

Farm Configuration information stored in configuration db

Central Administration content stored in own content db

Most Service Applications have at least one db

All Web Applications have at least one content db

Farm has several databases; >20 if spousal installation

Page 9: Optimize SQL server performance for SharePoint

Basic SharePoint DB concepts

Operating System settings

SQL Server configuration

Databases configuration

SharePoint and SQL Server integration concepts

SQL Server optimization

HA and DR : Always On Availability Groups & SP 2013

Page 10: Optimize SQL server performance for SharePoint

Optimize Hardware

CPU RAM DISK Network

Page 11: Optimize SQL server performance for SharePoint

Network (dedicated subnet for SQL)

Latency between web front ends and SQL

Server

• Mandatory for stretched farm, but good practice:

• < 1 ms during10 minutes (1% failure max)

• 1 Giga bits / sec

• Recommended if mirroring or Always On Sync (see later)

Page 12: Optimize SQL server performance for SharePoint

64K is optimal, 4K = 30% Performance

Penalty (data files, not log files)

Use chkdsk <drive>to Verify

Use Format to Configure:

• Format <drive> /Q /FS:NTFS /A:64K /V:<volume> /Y

Page 13: Optimize SQL server performance for SharePoint

• As part of capacity plan• Determine how much GB you need• Talk to the SAN team

Because…

Page 14: Optimize SQL server performance for SharePoint

Database name IOPS requirements Typical load on I/O

subsystem. Optimization

TempDB High 2 IOPS/GB Write

Content DB High

0.5-0.75 IOPS/ GB (4

TB supported:

0.25IOPS/GB , ideally:

2 IOPS/GB)

Read

Transaction Log High 2 IOPS/GB Write

Search Crawl database Medium to high IOPS

10 IOPS per 1

document per second

(DPS) crawl rate.

Write

Search Link database Medium IOPS

10 IOPS per 1 million

items in the search

index.

Search administration

databaseLow IOPS Not applicable.

Search Analytics

reporting databaseMedium IOPS Not applicable.

Page 15: Optimize SQL server performance for SharePoint

• IOMeter (free)

• SQLIO (free)

• …

• In production : be careful

• Test with a file > than SAN cache

• Test reading/writing , random 64k (for data)and sequential (for transaction log)

Page 16: Optimize SQL server performance for SharePoint

Basic SharePoint DB concepts

Operating System settings

SQL Server configuration

Databases configuration

SharePoint and SQL Server integration concepts

SQL Server optimization

HA and DR : Always On Availability Groups & SP 2013

Page 17: Optimize SQL server performance for SharePoint

For SharePoint 2013:

• SQL Server 2008 R2 SP1

• SQL Server 2012 (SP1 for BI)

• SQL Server 2014 (SP2013 SP1 & April CU)

For SharePoint 2016:

• SQL Server 2014

• SQL Server 2016

Don’t install SSMS on the SQL Server computer

Use named instances

\ SharePointUse a dedicated

instance

Run the service with a Managed account

No specificpermission

Page 18: Optimize SQL server performance for SharePoint

Latin1_General_CI_AS_KS_WS (for SharePoint databases)

(Any CI collation is supported for tempDBs, master, but Latin1_xxx_ is recommended)

SP uses this collation when itcreates its own db

Cannot be changed after the setup !!!

Page 19: Optimize SQL server performance for SharePoint

Max degree of parallelism

Maxdop=1

Page 20: Optimize SQL server performance for SharePoint

Specify memory limits

Page 21: Optimize SQL server performance for SharePoint

Backups

Compression

Page 22: Optimize SQL server performance for SharePoint

Use alias for the connection string

• Client alias or DNS alias (preferred)

Good practice : every SP Content db must becreated (and documented) by a DBA after a strict capacity plan

Page 23: Optimize SQL server performance for SharePoint

Basic SharePoint DB concepts

Operating System settings

SQL Server configuration

Databases configuration

SharePoint and SQL Server integration concepts

SQL Server optimization

HA and DR : Always On Availability Groups & SP 2013

Page 24: Optimize SQL server performance for SharePoint

System databases

Master : similar to the SP configDB

Model : templatefor other dbs

Tempdb : temporarily results

Msdb : for automation

User databases The SharePoint databases

Page 25: Optimize SQL server performance for SharePoint

.MDF.LDFAddContent

Content Database

Checkpoint

instructions

instructions

Simple Recovery Model

Page 26: Optimize SQL server performance for SharePoint

.LDF

Data

Data

.MDFAddContent

Content Database

Checkpoint

instructions

instructions

Full Recovery Model (Recommended)

Data Files and Log files should be on different drives (and not the System drive)

Page 27: Optimize SQL server performance for SharePoint

Model db : recoverymodel = full

Tempdb : recovery model = simple

SharePoint DB : recoverymodel ?

Contend DB = full Config DB= simple

Services App DBs= itdepends :

• http://technet.microsoft.com/en-us/library/cc678868.aspx

Always On Availability groups: recovery = full !

(UAT & Production)

Developer Workstation /Test Farm: recovery = simple!

Page 28: Optimize SQL server performance for SharePoint

Increase Initial sizeIncrease Autogrowth

(MB , not %)

Don’t modify Model dbcollation Full Recovery Model

Page 29: Optimize SQL server performance for SharePoint

Configure Tempdb files

•#files = #cores

• (on sql server 2012 Max 8 if #cores > 8)

•Same size for every file

Configure Tempdb Size

•At Least 10% of Biggest Content DB’s Size

Tempdb Database Settings

• Increase Initial Size Setting

• Increase Autogrowth Settings (Use MB Not %)

•Use Simple Recovery Model

•Place on Different Drive Than Content Databases

Page 30: Optimize SQL server performance for SharePoint

Priority (Fastest to Slowest Drive)

Tempdb Data and Transaction Log Files

Content DataBaseTransaction Log Files

Search Database Data Files

Content Database Data Files

Use Multiple Data Files for Content and Search DB’s

Distribute Equally-Sized Data Files Across Separate Disks

Number of Data Files Should Be <= Number of Processor Cores

Page 31: Optimize SQL server performance for SharePoint

Basic SharePoint DB concepts

Operating System settings

SQL Server configuration

Databases configuration

SharePoint and SQL Server integration concepts

SQL Server optimization

HA and DR : Always On Availability Groups & SP 2013

Page 32: Optimize SQL server performance for SharePoint

Setup account(sp-install)

Must be:(SQL Server)

DBcreator(SQL Server) Securityadmin

Local admin Domain account

Page 33: Optimize SQL server performance for SharePoint

Farm has several databases; >20 if spousal installation

Site Collections only reside in one database

Content database contains multiple site collections (2,000 Default Setting)

If Site Collection > 100GB store in own content database

• Soft limit maximum size <= 200 GB

Page 34: Optimize SQL server performance for SharePoint

Job will defragment the indices

If fragment > 30% &

rowcount > 10.000

Job will update statistics

AUTO_CREATE_STATISTICS

OFF

Page 35: Optimize SQL server performance for SharePoint

DBCC CheckDB

Check REPAIR_REBUILD Option to Fix Errors (Not

Always Possible)REPAIR_ALLOW_DATA_

LOSS Not Supported

Time Consuming Operation, Run During

Non-Peak Hours

For Very Large DBs consider using option

MAXDOP=1

Page 36: Optimize SQL server performance for SharePoint

Basic SharePoint DB concepts

Operating System settings

SQL Server configuration

Databases configuration

SharePoint and SQL Server integration concepts

SQL Server optimization

HA and DR : Always On Availability Groups & SP 2013

Page 37: Optimize SQL server performance for SharePoint

CPU

I/O (Iometer is a tool to check your SAN)

Network

Memory

Run a trace of Performance Counters (24 hours)

Provides templates of accuratecounters

Analyse regarding thresholds

Generate meaningfull reports

Use PAL (free)

(« Performance Analysis of Logs ») or SCOM

Use this trace as a baseline!!!

In production (live) Or Use Visual Studio (for Web performance Tests, simulate actions, number of users)

Page 38: Optimize SQL server performance for SharePoint

Counters: Should be:

Memory: Available Bytes At least 4 GB for the system

Logical Disk: Disk Reads/sec Between 15 and 25 ms

Logical Disk: Disk Writes/sec Between 15 and 25 ms

Process: cpu/working set/io SQLsrve.exe % other processes

Processor Max 40%

SQL Server: Buffer Manager: Buffer Cache Hit

Ratio

>97%

SQLServer: Buffer Manager: Page life

expectancy

> 300 sec (but do a baseline)

38

Page 39: Optimize SQL server performance for SharePoint
Page 40: Optimize SQL server performance for SharePoint
Page 41: Optimize SQL server performance for SharePoint
Page 42: Optimize SQL server performance for SharePoint
Page 43: Optimize SQL server performance for SharePoint

Part of SQL Server Enterprise (since SQL 2008)

Limits CPU and memory usage on some DBs (and IO in SQL Server 2014)

• like search DBs

Allow less CPU & mem & IO usage during work hours

Allow more CPU & mem & IO usage during off hours

Page 44: Optimize SQL server performance for SharePoint

Basic SharePoint DB concepts

Operating System settings

SQL Server configuration

Databases configuration

SharePoint and SQL Server integration concepts

SQL Server optimization

HA and DR : Always On Availability Groups & SP 2013

Page 45: Optimize SQL server performance for SharePoint

SQL 1

FARM 1

SQL 2

High Availabilty

Synchronous

Page 46: Optimize SQL server performance for SharePoint

SQL 1

FARM 1

SQL 2

SynchronousHigh Availabilty

Page 47: Optimize SQL server performance for SharePoint

Database Supported

Admin Content Yes

App Management Yes

BDC Yes

Config Yes

Content Yes

Managed Metadata Yes

PerformancePoint Yes

PowerPivot Not Tested

Project Yes

Search Analytic Reporting Yes

Search Admin Yes

Database Supported

Search Crawl Yes

Search Links Yes

Secure Store Yes

State Service Yes

Subscription Settings Yes

Translation Services Yes

UPA Profile Yes

UPA Social Yes

UPA Sync Yes

Usage(=loggingDB) Yes – NR

Word Automation Yes

Page 48: Optimize SQL server performance for SharePoint

SQL 1

FARM 1

SQL 2

FARM 2

SQL 3

Asynchronous

DisasterRecovery

Synchronous

Page 49: Optimize SQL server performance for SharePoint

Database Supported

Admin Content No

App Management Yes

BDC Yes

Config No

Content Yes

Managed Metadata Yes

PerformancePoint Yes

PowerPivot Not Tested*

Project Yes

Search Analytic Reporting No

Search Admin No

Database Supported

Search Crawl No

Search Links No

Secure Store Yes

State Service No

Subscription Settings Yes

Translation Services Yes

UPA Profile Yes

UPA Social Yes

UPA Sync No

Usage Yes – NR

Word Automation Yes

Page 50: Optimize SQL server performance for SharePoint

SharePoint Saturday Montreal#SPSMontreal

5h00 PM

3971 Ontario E

Page 51: Optimize SQL server performance for SharePoint

Merci !

@thesqlgrrrl @sergeluca


Recommended