8. Kanwal Khipple
Personal Professional Commun
• Canadian, Eh!
• Home – Toronto
• Currently living in New Jersey
• Bachelor of Mathematics
• Proud Father of Paras
SP …
9. Kanwal Khipple
Professional Personal Commu
• Principal SharePoint Architect
• BrightStarr.com - Microsoft Gold Partner
• Focus on User Experience – not design
• Delivered 200+ successful projects in the past 5 years
SP …
10. BrightStarr – Your SharePoint Partner of Choice
One of Microsoft’s 1st Digital Marketing Gold
Partners
BrightStarr was recently featured on
http://sharepoint.microsoft.com
http://www.brightstarr.com
1st non-Microsoft commercial public-facing
website
Built on SharePoint 2010
12. Kanwal Khipple
Community Personal Profession
• SharePoint MVP (2009, 2010, 2011 – Present)
• Co-Founder & Organizer for SharePoint Saturday Toronto
• Co Founder of Toronto SharePoint Business User Group
• Love to travel; 80,000+ km in 2011
• Twitter, Facebook & LinkedIn
SP …
17. Administrator
Basics Hardware Software Configurat
• Start with Hardware and Software Requirements
• Enable only those services that you require
• 16GB of RAM is a good start
SP …
18. Administrator
Hardware Software Configuration Ba
• Start with two WFEs
• Old Network? Invest for the long term
• Use RAID5 for better read performance
• Allocate dedicated disks for tempdb
• Trim transaction logs
SP …
19. Administrator
Software Configuration Basics Hardw
• Keep software up to date
• Test Service Packs and Cumulative Updates
SP …
20. Administrator
Configuration Basics Hardware Softw
• Configure Application Pool to recycle
• Dedicated accounts
• Leverage Caching (Page Output, Object, Disk Based)
• Configure IIS for Static Compression
• Configure HTTP Request Throttling
• Dedicated Caching Accounts
• Separate Search Scopes
SP …
22. Developer
Basics Out of Box Custom Code Brandin
• Dispose if an object implements iDisposable
• Reduce hydration
• Strip Unnecessary permissions
• Client side code efficiency
SP …
23. Developer
Out of Box Custom Code Branding Bas
• Index your columns
• Performance Throttling
SP …
24. Developer
Custom Code Branding Basics Out of B
• Reduce SQL server round trips
• Preload data better than AJAX
• Leverage cache effectively
• Query using Search API
SP …
25. Developer
Branding Basics Out of Box Custom Co
• Cut the page fat
• Combine and minify (js, css & images)
• Leverage CanaDiaNs ;)
• Turn off View State
SP …
30. Tools
Microsoft 3rd Party
• SharePoint Administrator Toolkit
• SharePoint Diagnostic Studio
• Internet Explorer Developer Toolbar
• Visual Studio Team Edition for Testers
• SharePoint 2010 Developer Dashboard
• Performance Monitor
• SQL Profiler
SP …
31. Tools
3rd Party Microsoft
• Fiddler
• Firebug
• Firefox Web Developer Toolbar
• YSlow
SP …
36. Kanwal Khipple
Professional Personal Commu
• Focus on User Experience – not design
• Delivered 25+ projects in the past 4 years
• Principal SharePoint Architect
• BrightStarr.com - Microsoft Gold Partner
SP …
39. Thank you for being a part of
#SPSBos
Sponsors Announcements Communities
40. Thank you for being a part of
#SPSBoston
Announcements Communities Sponso
• Feel free to “tweet and blog” during the session
#spsbos
@kkhipple
41. Thank you for being a part of
#SPSBoston
Communities Sponsors Announcement
Editor's Notes
template
Optimizing SharePoint 2010 for Internet Sites
Agenda – quick walk throughTop 10 Performance Tips for Making your Public Facing SharePoint 2010 site Fasteri originally want to provide 10 tips and deciding to include a few more cause I know in Texas, ya’ll have that saying – everything is biggerThis presentation is focused on public facing sites. Many of the tips can be used for intranets, extranets and are certainly applicable.This is a level 200 session that includes beginner / intermediate tipsThere are tips for administrators as well as developersThere will no demo’sMy goal for this presentation is to give ideas on things you might not have considered I’d love to have a discussion around these tips and share your war stories
Ask the audience – how many of you are developers? Administrators? How many of you are currently considering sharepoint for your public facing site?
Now lets quickly discuss what we are here to talk about - Performance
Let me introduce you to the worlds fastest car - Bugatti Veyron Super SportIn2007 Bugatti set world record 253 mph and held itfor couple of yearsIn 2010 SSC Ultimate Aero beat it by 4 mph ... 257 mphIn 2011 Bugatti introduced a new car and set new world record 267 mph, 0-60 in 2.4 secsIt also holds a record for the most expensive car - base price starts at $2,400,000What I wanted to share was one thing - if you throw enough money at a goal, you can achieve it. But money is not enough. It takes dedication, experts in the field and some experience.Whether its in the world of building the fastest car or building fast sharepoint internet sitesIn the world of sharepoint, you can be efficient by not spending a lot. How so you ask?
Performance Basics - it’s all about planningProject Plan – not just a project plan but plan for everything. Security, dns changes, ssl certificates. There have been too many cases of projects that I was part of when I was an independent contractor that did not have project plans.don’t be lazy. - Pay attention to detail. This is not an intranet where there is a limited number of eyes (200, 500, maybe 20000 users. We are talking about a public facing site. This tip is not just ot just developers, but this includes everyone designers, administrators, BA’s and PMsDedicated – make sure you don’t install everything on the same server. Unless you are hosting my blog.ALarM – Application Lifecycle Management (ALM) is a continuous process of managing the life of an application through governance, development and maintenance. ALM is the marriage of business management to software engineering made possible by tools that facilitate and integrate requirements management, architecture, coding, testing, tracking, and release management.Load Testing – before you deploy the solution and launch the site to the millions of potential users, have you tested this on how your custom code / sharepoint hardware will perform under pressureCapacity planning – start with your concurrent users - Focus on analyzing the most frequently used transactions the system will serve, understanding how frequently they will be used and by how many users. Once you have that then you can start understanding your environment. Total daily users is another key indicator of the overall load the system will need to handle. Requests per second (RPS) – RPS is a commonly used indicator used to describe the demand on the server farm expressed in the number of requests processed by the farm per second, but with no differentiation between the type or size of requests. Public facing sites- focus on read onlyAny questions?
Now that we have the basics, alright lets move on the some of the tips that I have learned over the yearsI personally like to keep my presentations very informal. So feel free to jump in, share your war stories, ideas or raise your voice if you’d like to know more.Administrator / developerSharepoint buzz / tools
BasicsFollow hardware and software requirements – they are up on technet. Read them. You already did? Good, now read them again! – choose the right processors. All else being equal, the more cores the server has the more load it can sustainEnable only those services that you require – Not all service applications are created, configured or managed in the same waydon’t enablemysites if you aren’t going to use them for your public facing site. 16GB of RAM is a good start - Web server memory requirements are highly dependent on the number of application pools enabled in the farm and the number of concurrent requests being served
HardwareStart with two WFEs –Microsoft invested heavily into capacity planning and documented their resultsHaving a single WFE was always under heavy load / max. capacity and is the biggest bottleneck for performanceload balance them. Old Network? Invest for the long term – upgradenetwork cards, routers, switches.The network between farm servers should have at least 1 Gbps of bandwidth. Network latency between servers can have a significant impact on performance, so it is important to maintain less than 1 millisecond of network latency between the Web server and the SQL Server-based computers hosting the content databases.Use RAID - The way that you configure Web servers and application servers can have a big effect on throughput and availabilityPublic facing sites RAID5 provides better read performance and good writeRAID10 provides good read and good writeOptimize your SQL Server - A healthy database server has enough headroom for databases and log files, plus enough capacity to keep up with requests. Use the recommendations in the following list to keep database servers performing optimally.Monitor the sizes so you don’t run out of disk space. Pre-grow all databases and logs if you canDo not overload database servers by using too many databases or data. When you use SQL Server mirroring, do not store more than 50 databases on a single physical instance of SQL ServerLimit content databases to 200 GB.if you can absorb the downtime required to rebuild, defragment and rebuild indices dailymonitor the database server to make sure that it is responding correctly and is not overloaded. Allocate dedicated disks for tempdb- The Tempdb database is the temporary work storage area that is used when sorting content, and its location and configuration can impact SQL Server performance—and ultimately SharePoint’s performance Use at least four physical disks and use separate disks to keep the log files and swap drive separate from the Windows and program files drive. Testing and user data shows that overall farm performance can be significantly impeded by insufficient disk I/O for tempdb.Place the Tempdb database on the fastest I/O subsystem available. Use disk striping if there are many directly attached disks.Pre-allocate space for your Tempdb files by setting the Initial File size to a larger value so it can accommodate the typical workload in your environment.Create multiple data files to maximize disk bandwidth. This reduces Tempdb storage contention and yields better scalability.Make each of these files the same size; this allows for optimal proportional-fill performance.Allow your Tempdb files to grow automatically as needed.Set the file growth increment to a reasonable size to prevent the database files from growing in small increments. See Table 1 for suggested growth settingsTrim transaction logs - For transaction logs, you should back up and truncate the log file every five minutes. However, never shrink the transaction log because you may experience performance issues while the log re-grows.http://mscerts.programming4.us/sharepoint/optimizing%20sql%20server%20for%20sharepoint%202010%20(part%204)%20-%20pre-creating%20your%20content%20databases.aspx
t is important to keep current by applying the latest hotfixes, updates, and service packs. These updates contain important product enhancements and improvements. However, make sure that you thoroughly test these updates on the pre-production environments before you apply them to the production environments. Turn on Windows Update to download updates automatically, but not install automatically.> System rebootSchedule time to install updates at off-peak hours.For high availability, rotate servers out of service one at a time during the update process.Make sure that you are patching the BIOS (server computers, controllers, and disks), Windows operating system, Microsoft SharePoint Foundation 2010 and SharePoint Server 2010, and SQL Server.Ensure all services work after SP / CU / Upgrade– test in uat, staging, test environment
Configure Application Pool to recycle Set up a scheduleGet to know your application, it's usage, and it's response times by studying the IIS logs. One of the ways to do this is to use the free SharePoint Flavored Weblog Reader (SFWR) tool.The first authenticated user may experience a very poor response time. Consider warming up SharePoint.Dedicated AccountsFor publishing sites, the caching processes run under the application pool account.Want to increase performance by 30%? Dedicated services accounts for cache Super user reader / cache super user Isolate security roles - For best results, use separate accounts for the following:Web applications: Use different accounts based on your security requirements.Search account: Use one account for the farm.Excel Services account: Use one account for external connections.Leverage CachingPage output - One person takes the hit for others by triggering the page construction, compilation, and execution process (otherwise known as the ASP.NET 2.0 page life cycle)Object - it stores objects that are used in the page construction process to reduce the number of roundtrips to the database. These objects can include master pages, page layouts, and even the results generated from complex queries such as those from Content Query Web Parts.Disk based- SharePoint stores almost all content in a site, including cascading style sheets (CSSs), ECMAScript (JavaScript, JScript), and images within the site collection's content database. Each time a request is issued for a page, the SharePoint front-end Web server must go back to the database to retrieve these files. Disk-based caching enables administrators to configure a SharePoint Web application to persist these static files on the hard disk of the front-end Web server. Subsequent requests for a page cause the front-end Web server to bypass the database roundtrip by serving the file off the disk. Disk-based caching is configured within the web.config file of the SharePoint Web application, specifically by the <blobcache /> element. Attributes on this element allow administrators to enable or disable caching, and specify a regular expression that is used to determine which files to persist on the front-end Web server. Configure IIS for Static CompressionDynamic compression as long as the content is not massive. Get upto 85% compresssionConfigure http request throttling – allow PUT requests to make it throughability to throttle certain requests during high server loadthe server monitors workload every 5 secs and enters throtttling mode if the workload exceeds set values 3x in a rowduring throttling, any HTTP GET request sent to the server returns a 503 errorthis allows PUT request to make it throughhttp request throttling powershellcmdletsGet-SPWebApplicationHTTPThrottlingMonitorSet-SPWebApplicationHTTPThrottlingMonitorSeparate Search ScopesOptimizes the search query to focus a specific document librariesKeep an eye on Performance Counters - Monitor performance counters that are relevant for SharePointKey performance counters to monitor include the followingNetwork Wait Queue: at 0 or 1 for good performanceAverage Disk Queue Length (latency): less than 5 msMemory used: less than 70 percentFree disk space: more than 25 percentBuffer cache hit ratio: 90 percent or better
developer
Dispose if an object implements iDisposable- As in typical .NET Framework development, Office SharePoint Server is not a completely managed application. Many of the underlying components are still unmanaged objects that are contained in managed wrappers. Understanding when to dispose of objects when doing custom SharePoint development is very important because this concept concerns two very commonly used objects: SPSite and SPWeb. General rule - If an object implements IDisposable, call Dispose() as soon as the object is not needed. GIVEAWAY _ __Use the SharePoint Dispose Checker Tool (SPDispose) to find memory leaks in custom software.Reduce hydrationUnnecessarily creating Objects – the code creates two internal instances of the SPList object and must perform two roundtrips to the database to hydrate the objects. The proper way to do this would be to get a reference to the Pages list and retrieve the necessary properties as follows.string listTitle = SPContext.Current.Web.Lists["Pages"].Title; intpageCount = SPContext.Current.Web.Lists["Pages"].Count; SPListpagesLibrary = SPContext.Current.Web.Lists["Pages"]; string listTitle = pagesLibrary.Title; intpageCount = pagesLibrary.Count; Strip Unnecessary permissions - that the site is stripped of all but necessary permissions and identity information, and all code is secured. Client side code efficiency - approximately 50% of end user response time is comprised of client side processing of returned code. If your custom solution increases any of these, you can expect an adverse effect on end user response time.
Index your columns - Specific columns need to be indexedStart with the titleTarget audienceLook at the queries you are making and based off of that, determine which ones need to be indexedDon’t more than 5-7 indexes. More indexes put pressure on sql serverPerformance throttling – a bit for administrators but something that developers should be aware of- Leverage list view threshold - -Leverage list view lookup - Reduce how many list items are returned for large lists
Reduce SQL Server Round Tripsgoal reduce sql server round tripsFor core pages, we recommend no more than 2-3 SQL round trips. Reduced overall system throughput due to additional load on the database server. Preload data better than AJAX– goal – This technique reduces the size of the initial page load. There’s a certain balancing act. Performance wise, preloading data is better.Preload dataPreloading data and letting the client’s browser handling rotating content is better than ajax callsFor AJAX parts, the number of callbacks, and the payload for each callbackMake sure you test page performance when you have custom code on a page. Load content asynchronously. Lazy loading content asynchronously, and only as needed, is a slightly more advanced technique to reduce page payload. Leverage cache effectivelyCQWP uses CrossListQueryInfo and leverages caching and audience targeting.The Solution (READ THIS VERY CAREFULLY)Don't use the Content Query Web Part for large databases with very deep site tree structures. Create a custom web part with custom queries. Now you can create indexes that your queries can use. Do not put more than one Content query web part on a single page. If each query takes time and you have 5 instances of the web part, well I am sure you can do the math. Read the following MSDN article very carefully. Read the section on the object cache. http://technet.microsoft.com/en-us/library/cc298466.aspx. Specifically read the part on Cross-List Query Caching. The Content query web part uses cross-list queries. Do not be smart and say you do not need to read the article above because you already have. Do not be smart and skim over the section on the object cache section saying I already have this turned on. object cache is always turned on. However it requires to be configured. The MSDN article above explains how. You need to set the cache size large enough such that your large query results have a place to be stored. In order to do this you will have to use perfmon to monitor two SharePoint metrics under the SharePoint Publishing Cache Object: Cache Hit Ratio and Cache object discards. When querying less than 1000 lists, then use CQWPwhen querying for more than 1,000 lists. Then leverage search apiSQL GuidanceImplement a caching strategy – this reduces the overall number of calls from the Web server(s) to the database server.Optimize custom code to use object methods which return your desired data in the most efficient manner (e.g. introduce indexes on lists, etc.)Distribute your SQL databases across multiple physical database serversQuery using Search APIInstead of the using the CQWP, leverage the search api
Cut the page fat – Keep code size to a minimum. A relatively small increase in page size can have a significant impact on performance if that page is accessed by a large number of people every day, especially during peak hours.Remove core.js where possibledont show ribbon by default - Only show it when its necessaryCombine and minify – Javascript, css and imagesRemove commentsRemove whitespaceThere are tools to do thisFor example, in one of my client’s websites, I found comments in a previously deployed master page that added 5KB to the page payload size. Leverage Canadians ;) – CDNs have two benefits. First, they speed up loading assets. Assets are loaded to users’ browsers from the closest servers possible. Second, CDNs reduce the amount of bandwidth consumed between the SharePoint servers and browsers, thus saving you money on bandwidth usage. Turn off View State - Turn off View State. Another overlooked performance tweak is turning off the View State mechanism for the controls you place in web pages. This helps reduce page payload considerably. Unless your controls require that the View State mechanism be enabled, turning it off won’t adversely affect your website. For anonymous public-facing Internet sites, View State typically isn’t required.The amount of data that a control stores in its ViewState property varies. A small view state of 1,500 to 2,000 bytes is pretty typical for a page in a SharePoint website. However, you’d be surprised how many SharePoint sites have a view state of 9,000 bytes or more. It might not sound like a big difference, but the bytes add up.
Sharepoint buzz – more tipsGive away sharepoint bag
Secure your siteBy default, all SharePoint sites have a permission level named Limited Access, which is granted to all users who have access to a SharePoint site. The Limited Access permission level grants the View Application Pages right, which enables users to view all the SharePoint system pages for items such as lists.You can leverage ViewFormsLockdown feature to disable Anonymous access to administrative pagesAccessibilityRemove ActiveXFriendly Error PagesExtensible Configuration
tools
Use the SharePoint Dispose Checker Tool (SPDispose) to find memory leaks in custom software.Use System Center Operations Manager for monitoring SharePoint or a 3rd party tool like Quest Foglight for ASP. Foglight can capture trends like page load times as well as consolidate performance counters. Get the SharePoint Administration Toolkit. It contains a load testing kit that can be employed to determine if an environment is able to handle the current load. It also contains SharePoint Diagnostic Studio 2010, a tool used by Microsoft personnel for troubleshooting. It's able to capture lots of information about performance counters, ULS log files, and so on. See here for more information.Get PAL, a tool for troubleshooting performance troubles. See here and here.
What tools do you use? Recommend?
Review– quick walk throughJust to set expectations.i originally want to provide 10 tips and deciding to include a few moreThis is a level 200 session that includes beginner / intermediate tipsThere are tips for administrators as well as developersThere will no demo’sMy goal for this presentation is to give ideas on things you might not have considered I’d love to have a discussion around these tips and share your war stories
Agenda – quick walk throughTop 10 Performance Tips for Making your Public Facing SharePoint 2010 site Fasteri originally want to provide 10 tips and deciding to include a few more cause I know in Texas, ya’ll have that saying – everything is biggerThis presentation is focused on public facing sites. Many of the tips can be used for intranets, extranets and are certainly applicable.This is a level 200 session that includes beginner / intermediate tipsThere are tips for administrators as well as developersThere will no demo’sMy goal for this presentation is to give ideas on things you might not have considered I’d love to have a discussion around these tips and share your war stories