23
Take SharePoint® to new heights. Consider performance & Security for SharePoint © 2013 Bamboo Solutions Corporation All Rights Reserved

Consider performance and security for SharePoint WP/App

Embed Size (px)

DESCRIPTION

Consider performance and security for SharePoint WP/App, apply to SharePoint 2010, 2013...

Citation preview

Page 1: Consider performance and security for SharePoint WP/App

Take SharePoint® to new heights.

Consider performance & Security for SharePoint

© 2013 Bamboo Solutions CorporationAll Rights Reserved

Page 2: Consider performance and security for SharePoint WP/App

Take SharePoint® to new heights.About Author: Nguyen Tuan Hai Team Lead at Bamboo Solutions Blog: http://tuan-tomy.blogspot.com Twitter: @tuantomy Linked: #nsuthaibanhxeo

2© 2013 Bamboo Solutions CorporationAll Rights Reserved

Page 3: Consider performance and security for SharePoint WP/App

Take SharePoint® to new heights.Getting Start

3© 2013 Bamboo Solutions CorporationAll Rights Reserved

Roll-up data from many sources

Process on large number of items

Page 4: Consider performance and security for SharePoint WP/App

Take SharePoint® to new heights.Contents Define performance and security issue in project Solutions Tools to monitor life-cycle and logging Demo Q&A

4© 2013 Bamboo Solutions CorporationAll Rights Reserved

Page 5: Consider performance and security for SharePoint WP/App

Take SharePoint® to new heights.Define

Heavy load page• Product: web part, application page, custom action…• Configuration: stand-alone, small farm, scaled farm, large farm…• Network: LAN, remote…• System: IIS, SQL Server

5© 2013 Bamboo Solutions CorporationAll Rights Reserved

Page 6: Consider performance and security for SharePoint WP/App

Take SharePoint® to new heights.Define

Product• Bottle-neck (code)• Large list• Dispose• Application pool

6© 2013 Bamboo Solutions CorporationAll Rights Reserved

Page 7: Consider performance and security for SharePoint WP/App

Take SharePoint® to new heights.Define

Configuration• Best practice installation• Load balancing• Services• Cache: disk-based BLOB caching, output cache, bit rate throttling

7© 2013 Bamboo Solutions CorporationAll Rights Reserved

Page 8: Consider performance and security for SharePoint WP/App

Take SharePoint® to new heights.Define

Network• Hardware installation• Local Area Network• Distributed database

8© 2013 Bamboo Solutions CorporationAll Rights Reserved

Page 9: Consider performance and security for SharePoint WP/App

Take SharePoint® to new heights.Define

System• Recycle application pool• Indexing configuration on database• Double-hop of SQL Server

9© 2013 Bamboo Solutions CorporationAll Rights Reserved

Page 10: Consider performance and security for SharePoint WP/App

Take SharePoint® to new heights.Define

Security• Code: Cross-site scripting, query string, injection, validation page, permission per user…• Service accounts

10© 2013 Bamboo Solutions CorporationAll Rights Reserved

Page 11: Consider performance and security for SharePoint WP/App

Take SharePoint® to new heights.Solutions

Indicate the number of artifactsScope/narrow down objects

11© 2013 Bamboo Solutions CorporationAll Rights Reserved

Web Parts

WP Page

Media Library

Plain Content

RequestServe

r

Page 12: Consider performance and security for SharePoint WP/App

Take SharePoint® to new heights.Solutions

WebPart

12© 2013 Bamboo Solutions CorporationAll Rights Reserved

Request

Web part

Bottle-neck

Server

Web part List

SP Applicatio

n

Timer Job

ServerRoll-up data

Page 13: Consider performance and security for SharePoint WP/App

Take SharePoint® to new heights.Solutions

BLOB and Caching

13© 2013 Bamboo Solutions CorporationAll Rights Reserved

Page 14: Consider performance and security for SharePoint WP/App

Take SharePoint® to new heights.Solutions

Query on large list

14© 2013 Bamboo Solutions CorporationAll Rights Reserved

SPQuery query = new SPQuery();query.RowLimit = 2000;query.ViewFields = “CAML_Query”;

SPListItemCollection collection;

do{ collection = list.GetItems(query); //Processing data query.ListItemCollectionPosition = collection.ListItemCollectionPosition;

} while (query.ListItemCollectionPosition != null);

Page 15: Consider performance and security for SharePoint WP/App

Take SharePoint® to new heights.Solutions

Cache SharePoint objectsLoop statement

15© 2013 Bamboo Solutions CorporationAll Rights Reserved

Page 16: Consider performance and security for SharePoint WP/App

Take SharePoint® to new heights.Solutions

Best practice installationManage service accounts

16© 2013 Bamboo Solutions CorporationAll Rights Reserved

Page 17: Consider performance and security for SharePoint WP/App

Take SharePoint® to new heights.Solutions

Check user permissions appropriately

17© 2013 Bamboo Solutions CorporationAll Rights Reserved

SPSecurity.RunWithElevatedPrivileges(delegate(){ //TODO: Your Code Here});

try{ list.CheckPermissions(SPBasePermissions.ApproveItems);}catch (UnauthorizedAccessException ex){//Throw exception here}

Page 18: Consider performance and security for SharePoint WP/App

Take SharePoint® to new heights.Tools

18© 2013 Bamboo Solutions CorporationAll Rights Reserved

MSOCAF• Test cases

Page 19: Consider performance and security for SharePoint WP/App

Take SharePoint® to new heights.Tools

19© 2013 Bamboo Solutions CorporationAll Rights Reserved

MSOCAF• Report result

Download: https://caf.sharepoint.microsoftonline.com/

Page 20: Consider performance and security for SharePoint WP/App

Take SharePoint® to new heights.Tools

20© 2013 Bamboo Solutions CorporationAll Rights Reserved

Developer dashboard• New feature of SharePoint 2010

Page 21: Consider performance and security for SharePoint WP/App

Take SharePoint® to new heights.Tools

21© 2013 Bamboo Solutions CorporationAll Rights Reserved

Developer dashboard• Turn on developer dashboard running on

demand$service = [Microsoft.SharePoint.Administration.SPWebService]::ContentService$addsetting =$service.DeveloperDashboardSettings$addsetting.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::OnDemand$addsetting.Update()• Turn on developer dashboard

• Turn off developer dashboard

$service = [Microsoft.SharePoint.Administration.SPWebService]::ContentService$addsetting =$service.DeveloperDashboardSettings$addsetting.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::On$addsetting.Update()

$service = [Microsoft.SharePoint.Administration.SPWebService]::ContentService$addsetting =$service.DeveloperDashboardSettings$addsetting.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::Off$addsetting.Update() 

Page 22: Consider performance and security for SharePoint WP/App

Take SharePoint® to new heights.Demo

22© 2013 Bamboo Solutions CorporationAll Rights Reserved

• Dispose SharePoint Objects

• Retrieve data from large list • Use MSOCAF to check the code

Page 23: Consider performance and security for SharePoint WP/App

Take SharePoint® to new heights.References References:

• http://msdn.microsoft.com/en-us/library/gg552614(v=office.14).aspx

• http://www.alachisoft.com/storageedge/sharepoint-performance-scalability.html

• http://bestofcyber.wordpress.com/2008/10/16/best-coding-techniques-to-improve-performance-for-sharepoint-applications/

• http://technet.microsoft.com/en-us/magazine/2009.08.insidesharepoint.aspx

• http://blogs.msdn.com/b/sowmyancs/archive/2008/10/26/best-practices-sharepoint-object-model-for-performance-tuning.aspx

Thank you!

23© 2013 Bamboo Solutions CorporationAll Rights Reserved