SharePoint 2010 Server Performance Monitoring from Developer Perspective

There are different tools and techniques to monitor and optimize SharePoint 2010 server farm. There are two perspectives for monitoring and optimizing the SharePoint, first is the administration and other is custom development. The custom development involves implementation of web parts, master pages, info path forms and application pages. We will be discussing following areas to optimize and monitor SharePoint server farm for custom development.

SharePoint 2010 developer dashboard

It is perfect tool for developers to identify slowness of the page rendering. It contains information about Web Parts, events, DB calls and whole lot minor details It can be configured through PowerShell command.
How to enable developer dashboard
The developer dashboard has three modes:
Off: In this mode, the dashboard is never shown. This mode is appropriate for production and customer-facing sites when you are not troubleshooting page performance.
On: In this mode, the dashboard is always shown. This mode is appropriate when you are testing the performance of every page in a lab environment.
OnDemand: In this mode, an icon appears in the top right of the page. Users can click this icon to view the dashboard. This mode is appropriate when you are troubleshooting individual pages.

PowerShell Command

$DevDashboardSettings =[Microsoft.SharePoint.Administration.SPWebService]::ContentService.DeveloperDashboardSettings;
$DevDashboardSettings.DisplayLevel = 'OnDemand';
$DevDashboardSettings.RequiredPermissions = 'EmptyMask';
$DevDashboardSettings.TraceEnabled = $true;

Whereis either “On”, “Off”, or “OnDemand”.

Screenshots for Developer Dashboard

Screenshot # 1:

Screenshot #2:

You can see that it has a Green border right now. That generally means it’s loading quick enough not to be a real problem. It can also render Yellow, which indicates that there’s a slight delay and then it could render a Red border which would mean you definitely need to look into it immediately!

Disposal Pattern


The Dispose Pattern is the approach used to properly dispose and clean up the resources you are using in your projects when programming in .NET.
There are some object in SharePoint 2010 which needs your special attention in custom development otherwise your application may suffer performance issues. These objects don’t get caught and disposed by the Garbage Collector in a timely fashion as most other objects do in .NET.

Why disposing these object manually?

·         Memory consumption.
·         The consumption of your server memory may peak and the worker process (w3wp.exe) may consume a lot more memory than it would normally have to consume.

·         Application Pool recycling.
·         If the worker process consumes too much memory, it’ll recycle the application pool.
·         If you’ve got an underperforming application causing overwhelming  memory consumption the Application Pool will recycle more often.
·         Performance issues!
·         Slow response times

Approach # 1 Manually calling Dispose()

SPSite  site = new  SPSite ("http://SiteURL/");
// Action code

Approach # 2: Encapsulating the statement in Using () block


(SPSite  site = new  SPSite ("http://SiteURL "));
// Do stuff

Approach # 3: Using try/finally Block

SPSite  site = null ;


site = new  SPSite ("http://SiteURL");
// do stuff


if (site!=null )

CSS sprite


CSS sprite is a technique used to reduce the number of http requests for images on a site when accessing it. Normally when you see a web site today there is plenty of files being requested and loaded upon the request made. You may check these request using fiddler tool. Using CSS sprites we can reduce the amount of files that we need to request from the server by consolidating many image files into one file and use CSS to display the correct part of that consolidated image when it needs to depict your
specific image.

CSS sprites are a natural part of a normal SharePoint 2010 installation. By default, there is CSS sprite techniques used to render and display images in (for example) the Ribbon menu.

You may use third party tools to generate CSS sprite code.

Crunching/Minify scripts


It is technique of eliminating useless characters from the script files to allow them to load faster. This means that by eliminating unnecessary whitespaces, line breaks and putting semicolons in the right places you can achieve a file size that is smaller than the original.

In SharePoint 2010 we already have a few examples of where JavaScript crunching is working in action. One example is the SP.js.

If you are using any custom javascript code, make sure to crunch them before uploading it to production server. There are many tools available in market for crunching your scripts

List of some tools:

Controlling ViewState


If you are developing SharePoint projects of any type, you’ve most certainly been doing some kind of UI development as well. (Application Pages, Web Parts, User Controls and so on) that are inheriting the capabilities and hence the ViewState.

As an ASP.NET developer you should know when and where to use the ViewState. It can be can disabled for certain components or for the entire page.

With an increased ViewState you get an increased Page Size which in turn obviously means that the page will take a bit longer to render.



The scope of this article  was to  mention key areas  for performance optimization in  SharePoint 2010 server from developer perspective. I believe above mentioned areas are  critical and should be implemented in custom development for better performance  in SharePoint  2010. We will be discussing best practices for sharepoint configuration and management in our next article.