24
SharePoint & SQL Server Working Together Efficiently Veenus Maximiuk SharePoint Architect ICC

SharePoint & SQL Server Working Together Efficiently

Embed Size (px)

DESCRIPTION

2013 Dogfood Conference. Improve SharePoint performance from SQL Server.

Citation preview

Page 1: SharePoint & SQL Server Working Together Efficiently

SharePoint & SQL Server

Working Together

Efficiently

Veenus Maximiuk

SharePoint Architect

ICC

Page 2: SharePoint & SQL Server Working Together Efficiently

About Me

2

Veenus Maximiuk, MCSA, MCITP, MCTS, MCPD, vTS

SharePoint Managing Architect

ICC

spvee.wordpress.com

@SharePointVee

Linkedin.com/in/vmaximiuk

[email protected]

I’m a SharePoint geek.

I know enough about SQL from SharePoint

perspective.

I’m NOT a SQL DBA.

Page 3: SharePoint & SQL Server Working Together Efficiently

Session Goals

3

SharePoint Admins and

SQL DBAs speak the same

language ”SharePoint”

Consolidate your

knowledge and hopefully

learn something new

Page 4: SharePoint & SQL Server Working Together Efficiently

4

Agenda Optimize SQL

Server instance

SharePoint

SQL

best practices

Optimize server for

SQL

Did you know...

Page 5: SharePoint & SQL Server Working Together Efficiently

Optimize server for

SQL

5

Page 6: SharePoint & SQL Server Working Together Efficiently

Disk layouts

6

Separate drives for

different purposes

Prioritize for faster

disk

• TempDB

• Logs

• Database

TempDB Logs Database OS Backup

Prioritize

Page 7: SharePoint & SQL Server Working Together Efficiently

Storage

Disk block

size

7

SQL Server pages are 8k in

size

Extents are a collection of

eight pages

Format drives with 64k

allocation unit

Page 8: SharePoint & SQL Server Working Together Efficiently

Antivirus

exclusions

8

File types to exclude:

• *.mdf

• *.ndf

• *.ldf

• *.bak

Clustering also exclude:

• <$windir>/cluster

• Witness \quorum disk

(if deployed)

Page 9: SharePoint & SQL Server Working Together Efficiently

Optimize SQL Server

instance

9

Page 10: SharePoint & SQL Server Working Together Efficiently

Dynamic

memory

management

10

Memory acquired is NOT released

Unless OS reports memory pressure

Min server memory

Min amount that SQL Server process may

trim in event of memory pressure

Max server memory

• Max amount that SQL Sever process

can allocate to the buffer pool

• Recommend to set to total MB minus

OS + app overhead

Page 11: SharePoint & SQL Server Working Together Efficiently

Memory

Allocation

11

The general recommendation

is to always set Max Server

Memory and to leave some

memory to always be available

for the OS.

SQL server will give back memory

if OS memory runs low but there

can be OS memory stress if SQL

does not respond fast enough to

sudden memory demands from

other processes on the system.

Physical

Memory

Setting

Memory to

Leave for OS

SQL Server Max

Server Memory

16GB 4GB 12GB

32GB 6GB 26GB

64GB 8GB 56GB

128GB 16GB 112GB

256GB 16GB 240GB

SQL Max Memory = TotalPhyMem - (NumOfSQLThreads * ThreadStackSize) - (1GB * CEILING(NumOfCores/4))

NumOfSQLThreads = 256 + (NumOfProcessors*- 4) * 8 (* If NumOfProcessors > 4, else 0)

ThreadStackSize = 2MB on x64 or 4 MB on 64-bit (IA64)

Page 12: SharePoint & SQL Server Working Together Efficiently

TempDB files

12

Same number of

data files as CPUsMax of 8

SELECT * FROM

sys.dm_os_schedulers

Use RAID-10 Pre-size TempDB

files25% of largest DB size

Set Auto Growth to

Fixed size <200 MB

Only one

transaction log file

Page 13: SharePoint & SQL Server Working Together Efficiently

Model

database file

settings

13

• SharePoint databases are

based off Model

• Consider changing the

settings

Page 14: SharePoint & SQL Server Working Together Efficiently

Max Degree

of Parallelism

11/24/2013 14

Controls the number of

processors that can be used

to run a single SQL Server

statement

MAXDOP for

SharePoint must be 1

Error message

when creating new

SP2013 farms

Page 15: SharePoint & SQL Server Working Together Efficiently

Other “Stuff”

11/24/2013 15

Instance collation

Latin1_General_CI_AS_KS_WS(case-insensitive, accent-sensitive, Kana-sensitive, and width-sensitive)

Windows

authentication

Access Services requires

Mixed Mode!

Auto shrink set to

off

Otherwise causes high

fragmentation

Set Fill Factor to 80

Page 16: SharePoint & SQL Server Working Together Efficiently

Demo

Optimize SQL Server instance

Page 17: SharePoint & SQL Server Working Together Efficiently

SharePoint

SQL

best practices

17

Page 18: SharePoint & SQL Server Working Together Efficiently

To alias or

not to alias

18

SQL Aliases

Page 19: SharePoint & SQL Server Working Together Efficiently

Naming

standards

19

No GUIDS

A standard is better

than no standard

Consider multiple

Farms and

environments

Page 20: SharePoint & SQL Server Working Together Efficiently

Detecting

index

fragmentation

20

Use ALTER INDEX

(REBUILD or

REORGANIZE) to

defrag indexes

Page 21: SharePoint & SQL Server Working Together Efficiently

SharePoint

Health

Analyzer

Rules

21

SharePoint maintains the index health

Stored Procedures proc_UpdateStatistics and

proc_DefragmentIndices in some database

Otherwise include in database maintenance plans

• Search Administration, Analytics, Links Databases

• Secure Store Database

• State Service Database

• Profile Sync Database

• Usage Database

• Managed Metadata Database

• Business Connectivity Services Database

• PerformancePoint Services Database

Page 22: SharePoint & SQL Server Working Together Efficiently

Did you know…

22

Page 23: SharePoint & SQL Server Working Together Efficiently

“Undocumented

feature”

11/24/2013 23

SharePoint databases copy only initial settings

Autogrow settings are not copied

Settings from model database apply to ALL

SharePoint databases

DBCC CHECKDB WITH REPAIR

AUTO_CREATE_STATS

AUTO_UPDATE_STATS

Auto create statistics modifies DB schema

Upgrade will break

Unsupported Leave autogrowth on

Don’t shrink transaction logs

Don’t forget

Page 24: SharePoint & SQL Server Working Together Efficiently

Questions?