Transcript Title

4
Ideas to Improve SharePoint Usage
What are these 4 Ideas?
1.
7 Steps to check SharePoint Health
2.
Avoid common Deployment Mistakes
3.
Analyze SharePoint Usage
4.
Which Pages are Slow and Why?
Bonus: Real Life Troubleshooting Example
7 Step SharePoint Health Check
#4: IIS Health
#5: AppPool
Health
#6: SQL & Service
Health
#7: Web Parts
#1: End User
Health
#2: Site Health
#3: System Health
Check #1: End User Health
#1: Geo Location
#3: Errors
#2: User
Environment
Check #2: Site Health
#1: Load
#2: Failures
#3:
Performance
#4:
Infrastructure
#5: End User
Index
Check #3: System Host Health
#1: CPU & Memory
#2: I/O: Static &
Logs
#3: Process Check:
Need to RE-DEPLOY?
Check #4: IIS Health
#1: Threads
#2: Throughput
#3: Page Size
Check #5: AppPool Health
#1: Memory
#2: Garbage
Collection
#3: Worker Threads
Check #6: SQL & Service Health #1: Excessive SQL
Roundtrips
#2: Connectivity
Issues
Check #7: Web Parts
#1: Performance
#3: Bad Coding: 211 SQL!
#2: Deployment
Avoid common Deployment Mistakes
CONNECTIVITY, MISSING FILES, PERMISSION, …
Who’s talking with whom?
How many Web Sites are
actually running?
Do we call any external
services
How many requests
make it to SharePoint’s
AppPool?
Is our SQL
Server
overloaded?
Any Deployment Mistakes? HTTP 5xx,
4xx?
Which Errors impact
how many users?
Which errors are thrown by which
page?
Any Bad WebPart?
WebParts that
can’t be loaded!
Here is the page that
uses this WebPart
Connectivity Issues between Services?
Watch out for
Connection Exceptions!
This is the page that
tries to connect to
that backend
service!
Root Cause:
Configuration Issue
Authentication Issues?
How many users have
authentication issues?
Which pages are users
trying to access?
User Permission Problems?
#1: Permission Issue
Detected!
#3: Here is the
problematic page
#2: Related to
SocialNavigationControl
Missing Lists?
List not found Exception!
Here is the page that
references this list!
Missing Columns?
Somebody deleted a
column?
Here is the page that
shows that column!
Bad Filter Settings?
Bad filter settings
result in Exceptions
Here is the page that
uses that bad filter!
Analyze SharePoint usage
WHO IS USING WHAT, HOW FROM WHERE?
How are people navigating through
Which browsers
Where are they
SharePoint? do
people use?
from? Which Office?
How do they navigate
through the site?
How fast/slow are
these pages for
them?
Maybe impacted
by bad network
connectivity?
Which Lists/Views are Used?
How often used?
High Failure Rate?
How fast/slow?
Time spent in SQL Server?
Same information
shown per List
Which pages are slow
HOW TO IDENTIFY THEM?
What are the top slowest end user
How Fast/Slow for
pages?
the end user?
How much of that
is Server Time?
What makes them slow?
How do these
pages load?
Lots of JavaScript
that loads slow?
Maybe cache on a
Proxy/CDN?
Reasons for slow pages
CLIENT AND SERVER SIDE
Many reasons for bad performance


Frontend

Overloaded and complex Pages

Too much JavaScript slows down older browsers

Bad content caching
Backend

Bad/Too Much Database Access

Bad Coding of custom code

Overhead due to configuration issues and resulting logs/exceptions

High Memory Consumption

Wrong Deployment Configurations (e.g: worker threads, …)
Overloaded Pages
Don’t overload with
too much information!
2.6MB for Home Page !
Database Impact: too many requests
211! SQLs per
Page Request
Database Impact: Same SQL
Same SQL called
many times per page!
Database Impact: Whom to blame?
 Overloaded
 Badly
 3rd
Pages with too many Web Parts
implemented custom web parts
party WebParts or Controls
Bad Coding of Custom Web Parts - #1
DO NOT
int noOfItems = SPContext.Current.List.Items.Count;
ALL List Items are retrieved from the Database
DO
int noOfItems = SPContext.Current.List.ItemCount;
Item Count is kept redundant in the AllUserData table and also kept in memory
Bad Coding of Custom Web Parts - #2
DO NOT
for (int itemIx=0;itemIx< SPContext.Current.List.Items.Count;itemIx++) {
SPListItem listItem = SPContext.Current.List.Items[itemIx];
// do something ...
}
Every access to Count and Items Property queries the whole SharePoint list
We end up with 202 SQL Executions with a total exec time of > 1s
Good Coding of Custom Web Parts DO
#2
SPListItemCollection items = SPContext.Current.List.Items;
foreach (SPListItem listItem in items) {
// do something ...
}
Only first access to the collection queries the data
Telerik Grid Control Going Wild
#1: Data Driven Problem
Depending on the user input
on that request we see up to
493! SQL Calls per request
Root Cause: Every Grid Cell
executed a new SQL
#2: Statements not prepared
None of these executions
has been prepared
High Garbage Collection
Memory Heavy Apps
result in High GC that
impacts Performance
High GC Result of High Memory Usage!
Analyze Memory
Patterns
Long Running
GCs!
High GC: Performance Heap Analysis
Which classes stay on
the heap?
Who is keeping
them in memory?
Which have the
biggest impact?
Real life Troubleshooting
THE JOURNEY OF A FRUSTRATED SHAREPOINT USER
Frustrated User report bad Response
Times
Frustrated User
Slow Page Load caused by Browser JS Time
Slow Page Load caused by Server-Side Processing
Really slow page
6.8s to deliver Default.aspx page
Involved Web Parts
Most of the Time spent in waiting
WebPart uses multiple parallel Threads
Async Threads are busy with I/O
First Remote Call is Very Slow
Web Service call by ContentEditorWebPart
HttpWebRequests uses ServicePoint internally
First Web Service Requests takes 5.8s to return
Thread Limit lets all other Threads wait!
The other background threads spend their time
“waiting” in the ServicePoint
We have 10 parallel calls in our background threads
Solution: Change Defaults
http://apmblog.compuware.com/2013/03/12/net
-and-sharepoint-performance-dont-let-defaultsettings-ruin-your-end-user-experience/
Key Points to Take Home
#4: IIS Health: Bandwidth?
Threads? HTTP 4xx, 5xx?
#5: AppPool Health: Memory,
CPU, GC, Exceptions, Logs
…
#6: SQL & Service Health: #
Roundtrips, Data Amount, CPU,
Memory, I/O
#7: Web Parts: 3rd Party &
Custom. Bad Coding and
Bad Deployments lead to
crashes
#1: End User Health: Happy or
Frustrated? Desktop or
Mobile?
#2: Site Health: Any Errors?
Any Performance Issues?
#3: System Health: CPU,
Memory, Process Distribution, …
More Links for You
Tools:
http://dynatrace.com/en/sharepoint
More Stories:
http://blog.dynatrace.com/
YouTube Tutorials:
http://bit.ly/dttutorials
Thank You!