Contenu connexe
Similaire à Consider performance and security for SharePoint WP/App (20)
Consider performance and security for SharePoint WP/App
- 1. Take SharePoint® to new heights.
Consider performance & Security for
SharePoint
© 2013 Bamboo Solutions Corporation
All Rights Reserved
- 2. 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 Corporation
All Rights Reserved
- 3. Take SharePoint® to new heights.
Getting Start
3© 2013 Bamboo Solutions Corporation
All Rights Reserved
Roll-up data from many sources
Process on large number of items
- 4. 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 Corporation
All Rights Reserved
- 5. 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 Corporation
All Rights Reserved
- 6. Take SharePoint® to new heights.
Define
Product
• Bottle-neck (code)
• Large list
• Dispose
• Application pool
6© 2013 Bamboo Solutions Corporation
All Rights Reserved
- 7. 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 Corporation
All Rights Reserved
- 8. Take SharePoint® to new heights.
Define
Network
• Hardware installation
• Local Area Network
• Distributed database
8© 2013 Bamboo Solutions Corporation
All Rights Reserved
- 9. Take SharePoint® to new heights.
Define
System
• Recycle application pool
• Indexing configuration on database
• Double-hop of SQL Server
9© 2013 Bamboo Solutions Corporation
All Rights Reserved
- 10. 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 Corporation
All Rights Reserved
- 11. Take SharePoint® to new heights.
Solutions
Indicate the number of artifacts
Scope/narrow down objects
11© 2013 Bamboo Solutions Corporation
All Rights Reserved
Web Parts
WP Page
Media Library
Plain Content
Request
Serve
r
- 12. Take SharePoint® to new heights.
Solutions
WebPart
12© 2013 Bamboo Solutions Corporation
All Rights Reserved
Request
Web part
Bottle-neck
Serve
r
Web part List
SP
Application
Timer Job
Serve
rRoll-up data
- 13. Take SharePoint® to new heights.
Solutions
BLOB and Caching
13© 2013 Bamboo Solutions Corporation
All Rights Reserved
- 14. Take SharePoint® to new heights.
Solutions
Query on large list
14© 2013 Bamboo Solutions Corporation
All 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);
- 15. Take SharePoint® to new heights.
Solutions
Cache SharePoint objects
Loop statement
15© 2013 Bamboo Solutions Corporation
All Rights Reserved
- 16. Take SharePoint® to new heights.
Solutions
Best practice installation
Manage service accounts
16© 2013 Bamboo Solutions Corporation
All Rights Reserved
- 17. Take SharePoint® to new heights.
Solutions
Check user permissions appropriately
17© 2013 Bamboo Solutions Corporation
All Rights Reserved
SPSecurity.RunWithElevatedPrivileges(delegate()
{
//TODO: Your Code Here
});
try
{
list.CheckPermissions(SPBasePermissions.ApproveItems);
}
catch (UnauthorizedAccessException ex)
{
//Throw exception here
}
- 18. Take SharePoint® to new heights.
Tools
18© 2013 Bamboo Solutions Corporation
All Rights Reserved
MSOCAF
• Test cases
- 19. Take SharePoint® to new heights.
Tools
19© 2013 Bamboo Solutions Corporation
All Rights Reserved
MSOCAF
• Report result
Download: https://caf.sharepoint.microsoftonline.com/
- 20. Take SharePoint® to new heights.
Tools
20© 2013 Bamboo Solutions Corporation
All Rights Reserved
Developer dashboard
• New feature of SharePoint 2010
- 21. Take SharePoint® to new heights.
Tools
21© 2013 Bamboo Solutions Corporation
All 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()
- 22. Take SharePoint® to new heights.
Demo
22© 2013 Bamboo Solutions Corporation
All Rights Reserved
• Dispose SharePoint Objects
• Retrieve data from large list
• Use MSOCAF to check the code
- 23. 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 Corporation
All Rights Reserved