Performance AnalysisSharePoint 2013
Robi VoncinaSharePoint Server MVP
Robi Vončina• Degree in economics• Started as MS Office instructor• System administrator• I started working with SharePoint from
2003 version on• Leader of SloSPUG
• MVP, MCSE, MCT
Agenda• Intro• Tools• Perfmon• Client Tools• SP Tools• IIS Tools• VS
• Configuration
Users want less than 3 seconds
Users will permit up to 5 seconds
Measure the end user experienceEffective Performance Analysis
Speed is a common complaint Users’ Reference
Performance Pyramid
Server Performance
Traffic
Configuration
LAN & WAN
User
Click icon to add picture
Tools
Click icon to add picturePerformance Monitor
Performance Monitor
Server Performance
Traffic
Configuration
LAN & WAN
User
Performance Monitor settings• The Process object in Performance Monitor can display Process IDs (PIDs)
• http://support.microsoft.com/kb/281884
• Click Start, click Run, type regedit, and then click OK.• Locate and then click the following registry subkey:HKEY_LOCAL_MACHINE\
SYSTEM\CurrentControlSet\Services\PerfProc\Performance• On the Edit menu, click New, and then click DWORD Value.• Right-click New Value #1, click Rename, and then
type ProcessNameFormat to name the new value.• Right-click ProcessNameFormat, and then click Modify.• In the Data value box, type one of the following values, and then click OK:
• 1: Disables PID data. This value is the default value.• 2: Enables PID data.
• Exit Registry Editor.
Performance Monitor• .NET CLR Exceptions • .NET CLR Loading• .NET CLR Memory• .NET Networking• ASP.NET• ASP.NET Applications• Memory• Network Interface• Physical Disk• Process• Processor• System• Web Service• Web Service Cache• Office Server Search Archival Plugin• Office Server Search Gatherer
• Add the Threads object when troubleshooting CPU Spikes/CPU high utilization.
• Make sure to use "Run As" so we can accurately capture the .NET counters. This should be run as the same account as the application pool.
• Setup performance logging at 5 second intervals.
• Select the Log Files tab and Configure button and set the preferred directory path and file name. Limit the log file size to 250 MB and hit OK.
Using Perfmon• Create baseline performance monitoring
• Compare baseline to performance monitoring when troubleshooting
• Generic Counters• Counter NameLook for…• \Memory\Available BytesMore than 500 MB (SQL is different)• \Memory\Pages/SecAre we paging?• \Processor(_Total)\% Processor TimeAnywhere above70%
means you might • having queuing • \PhysicalDisk%perdisk%)\Avg. Disk Queue • Length• Less than 2-5 per cluster• Drill down to reads/writes queue length• \PhysicalDisk(%perdisk%)\Disk Writes/secLook for constanthigh
values• \PhysicalDisk(%perdisk%)\Avg.Disk • sec/Transfer• Less than 20milliseconds• \Network Interface([network • interface])\Output Queue Length• 0• \Network Interface([network • interface])\Bytes Total/sec• make sure you’re up to 50% of network • capacity
• ASP.Net
• \ASP.NET Apps v4.0.30319(__Total__)\Request
• Execution Time < 0.5 seconds Keepin mind network and rendering times
• \ASP.NET Apps v4.0.30319 (__Total__)\Requests/Sec
• Rough indication of RPS
• \ASP.NET Apps v4.0.30319 (__Total__)\Request Wait Time
• Are requests gettingqueued?
• \ASP.Net\Worker Process Restarts• Are we crashing often?
• \Process\Virtual Bytes> 4GB is suspicious
Counters to look for:SharePointMonitor cache performance in SharePoint 2013http://technet.microsoft.com/en-us/library/ff934623(v=office.15).aspx
• \SharepointPublishing Cache(/)\Object cache flushes / second
• Cache flushes are bad!
• \SharepointPublishingCache(/)\Object Cache Hit Ratio
• >99% (cache hit vs cache miss)
• \SharepointPublishing Cache(/)\Object Cache Misses / sec
• Close to 0
• BLOB cache, ASP.NET output cache, object cache
SQL• Focus on CPU and Disk IO
• SQLServer:Locks(_Total)\Average Wait Time (ms)• 0
• SQLServer:Locks(_Total)\Number of Deadlocks/sec• 0
• \SQLServer:AccessMethods\Full Scans/sec• < 100. Full scans are bad
• \SQLServer:GeneralStatistics\User Connections
Look at trend: make sure we’re not leaking• \SQLServer:CacheManager\Cache Hit Ratio
• > 85%
• Do we need to add more memory?
DEMO
Click icon to add picture
Client Tools
Browser Timers
Server Performance
Traffic
Configuration
LAN & WAN
User
Fiddler• Flagging performance bottlenecks• Profiling the performance of your web app• Timeline for performance analysis• Simulate HTTP compression• Taking advantage of HTTP caching
Fiddler Add-Ons• Fiddler Html Inspector Part 3 | elastacloud = azurecoder +
bareweb• http://blog.elastacloud.com/2010/12/09/fiddlerhtmlinspector/
• Download Microsoft neXpert Performance Analysis Plugin from Official Microsoft Download Center• http://www.microsoft.com/en-us/download/details.aspx?id=11729
• StresStimulus | Load Testing Tool - Fiddler Extension• http://stresstimulus.stimulustechnology.com/
Fiddler Performance evaluation• Statistics• Request count• Bytes received
• Session list• Body• Caching• Consolidation
• Inspectors• Compression• Minification
• Timeline
DEMO• Load Test Reports• file:///C:/
Users/robi/Documents/Fiddler2/StresStimulus/SPCAdriatics_2014_10_15_16_19_18_997.htm
• file:///C:\Users\robi\Desktop\Xnet\Tecaji\SPCAdriatics\2014\neXpert_15102014163139.html
Network Sniffers
Server Performance
Traffic
Configuration
LAN & WAN
User
Visual Round Trip Analyzer and Network Monitor
• Analyses Web against list of known best practices• Expiration Date• Bandwidth Efficiency • Time to First Byte• Image clustering
• Utility Spotlight: 12 Steps To Faster Web Pages With Visual Round Trip Analyzer• http://msdn.microsoft.com/en-us/magazine
/dd188562.aspx
DEMO
Click icon to add picture
SharePoint Tools
Developer Dashboard• Enable Dev Dashboard – Off by default$svc = [Microsoft.SharePoint.Administration.SPWebService]::ContentService$dds = $svc.DeveloperDashboardSettings$dds.DisplayLevel = "On"$dds.Update()
• All request• SQL queries running against each request• ULS Logs• MDS
DEMO
Click icon to add picture
IIS Tools
Log Parser• Log parser is a powerful, versatile tool that provides universal
query access to text-based data such as log files, XML files and CSV files, as well as key data sources on the Windows operating system such as the Event Log, the Registry, the file system, and Active Directory• Demo queries
Log Parser Rocks! More than 50 Examples! | LichtenByteshttp://mlichtenberg.wordpress.com/2011/02/03/log-parser-rocks-more-than-50-examples/
• Uses SQL statements to query logs
Log Parser Charts• Download Office 2003 Add-in: Office Web Components from
Official Microsoft Download Center• http://www.microsoft.com/en-us/download/details.aspx?id=22276
DEMO
Click icon to add pictureLoad Testing with Visual Studio
Load Testing
Server Performance
Traffic
Configuration
LAN & WAN
User
What You Need• Visual Studio Ultimate• Windows 7/8• Windows Server 2012/2012 R2• A test environment• Nerves of steel
Terms• Performance Testing• Does it work?
• Load Testing• Does it really work?
• Stress Testing• When does it stop working?
• Capacity or Scale Testing• Will it work for us?
More Terms• Solution• One or more projects
• Project• One or more tests
• Web Test• A series of web requests• Can be one or more pages or actions
• Load Test• Execution of one or more web tests• Has settings like browser, networks, users
Project
Create Web Test• Record steps in Internet Explorer• Make sure recording bits work• Easier on workstation• One type of request per web test• Can also create with Fiddler
Create Load Test• Add web tests to load test• Pick network profile• Pick browser profile• Can add multiple workstations to test• Can monitor servers from VS• Can export results to Excel
Add Network Shims• Needed to simulate network connections• C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\
IDE\VSTestConfig.exe networkemulation /install
• Save results to SQL• C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\
IDE\loadtestrepository.sql
DEMO
Click icon to add picture
Configuration
Infrastructure• Capacity planning for
SharePoint Server 2013• http://technet.microsoft.com/e
n-us/library/ff758645(v=office.15).aspx
• Hardware and software requirements for SharePoint 2013• http://technet.microsoft.com/e
n-us/library/cc262485(v=office.15).aspx
Component Minimum requirement
Processor •64-bit, 4 cores for small deployments (fewer than 1,000 users)•64-bit, 8 cores for medium deployments (between 1,000 to 10,000 users)
RAM •8 GB for small deployments (fewer than 1,000 users)•16 GB for medium deployments (between 1,000 to 10,000 users)For large deployments over 10,000 users, see the "Estimate memory requirements" section in Storage and SQL Server capacity planning and configuration (SharePoint Server 2010). This document does not apply to search in SharePoint 2013.These values are larger than those recommended as the minimum values for SQL Server because of the distribution of data that is required for a SharePoint 2013 environment. For more information about SQL Server system requirements, see Hardware and Software Requirements for Installing SQL Server 2008 R2.
Hard disk 80 GB for system driveHard disk space depends on how much content that you have in your deployment. For information about how to estimate the amount of content and other databases for your deployment, see Storage and SQL Server capacity planning and configuration (SharePoint Server 2010).
Database maintanance• Download Database Maintenance for Microsoft SharePoint
2010 Products from Official Microsoft Download Center• http://www.microsoft.com/en-us/download/details.aspx?id=24282
SharePoint Caching• Page• First request served from DB• Subsequent requests for same
resource read from memory
• Disk• File system objects• Database objects not cached
• Object• Cross site queries
• Publishing Features Enabled• Output cache• Object cache
• Max Cache Size
• Disk cache – Web.config• BLOBs
IIS Compression• Turned On but not configured• Reduces size of files• Caches compressed content on disk• Increases CPU utilization• Compression range from 0-9• Does not effect dynamic content
retrieved from Database• No UI, must run scriptAppcmd set config /section:httpCompression –[name='gzip'].dynamicCompressionLevel:9Appcmd set config /section:httpCompression –[name='gzip'].staticCompressionLevel:9
Throttling and Locks• SQL Server escalates row locks to table locks >5000 items• Query throttling reduces the impact of any single request by
limiting the amount of data queried
Branding• Minify javascript and CSS
files• Images stiching (CSS
sprites)• Better perfomance with few
large files than lots of small files
• Store CSS, master pages on file system• („/_layouts“ folder)
• SpriteMe• http://spriteme.org/
• Images Folder or Layouts --_layouts\images\• Cache-Control: max-
age=31536000• Client does not always ask if
newer version exists
• Document or Images Library• Cache-Control: Max-age=0• Expires: Current Date minus 2
weeks• Client always ask if newer
version exists –fix use blob caching
List items• List and libraries can hold millions of items – doesn‘t mean
they should• All user content in entire site collection is stored in single table
in the content database• Folders improve view performance NOT query performance
List definitions• Columns• Lookup columns• More columns more SQL rows• Can drastically reduce performance
Custom code• Web.Lists[“Documents”]
• 1 RT, 252 Read IOps
• Web.GetList(“/Shared Documents”)• 1 RT, 8 Read IOps
• ScriptLink.Register(“sp.js”); • 2.0 second delay of page content
display (at 1mbps)• 3 other JS files automatically
registered
• ScriptLink.RegisterOnDemand(“sp.js”);• 0.0 second delay of page content
display
• List.Items.Count vs. List.ItemCount• SPQuery is your friend• Disposing objects
Free Tool for Monitoring• SharePoint Performance Monitor• http://www.idera.com/productssolutions/freetools/spperformancemoni
tor
questions?Hvala za pozornost…Vprašanja??
thank you.
SHAREPOINT AND PROJECT CONFERENCE ADRIATICS ZAGREB, 10/15/2014 - 10/16/2014