Muhammad Ali Khan

MS CRM 3.0, MS CRM 4.0, Sharepoint 2007 & Sharepoint 2010

Archive for December, 2009

Throttling: New Features of List in SharePoint 2010 (Part 2/2)

Posted by Ali Khan on December 22, 2009

This is my 2nd post regarding the new features of lists in SharePoint 2010.

As we know, we could run into performance de-gradation and SharePoint Server Slow Response with List in SharePoint 2007 as the list of the size increases, because even though Microsoft recommended storing not more than 2000 list items for best performance, there was not enough performance monitoring & control from SharePoint 2007 itself. Now Performance Control & Monitoring has been applied on List in SharePoint 2010 through “Throttling”. So first let see what is throttling?

Throttling

Here is the throttling definition from Microsoft SharePoint Evaluation Guide.

“Through throttling settings, SharePoint Server 2010 provides a way for administrators to determine the level at which the server will go into throttling mode. Every five seconds, a job runs that checks server resources compared to configured levels. By default, Server CPU, Memory, Request in Queue, and Request Wait Time are monitored. After three unsuccessful checks, the server enters a throttling period and will remain in this state until a successful check is completed. Requests that were generated prior to the server’s entering throttling mode will be completed. This will, in theory, keep users from losing any current work when the server begins to throttle requests. Any new HTTP GET and Search Robot requests will generate a 503 error message and will be logged in the event viewer. While the server is in a throttling period, no new timer jobs will be started.”

Here is the link to the “SharePoint Evaluation Guide

Throttling On SharePoint 2010 Lists

 As the items in the SharePoint list continue to grow, the performance of the queries retrieving data from the list decreases. To help SharePoint users, Microsoft has provided different Performance Control checks through “Resource Throttling” on lists in SharePoint 2010.

In order to go to these settings, follow this path, Central Administration ==> Application Management ==> Manage Web Application. Once in the Web Application List, select the web application and click General Settings ==> Resource throttling. See the diagram below.

image

image

Here is a tabular representation of some of the important values and their description

Property Description Default Value
List View Threshold The number of results that can be returned in a user query. If the limit exceeds this value, an “Expensive Query Exception” is thrown in the code. Note this limit is for a normal user. Administrator limit can be configured to be much more than this. 5000
List View Threshold for Auditors and Administrators Same as above but for the administrator and power users and this value is considerably higher than the “List View Threshold” value. 20,000
Warning Level A Warning Level for the administrator that their list is close to the threshold. Note, this option is configured only through “Power Shell”

E.g. Use this power shell command to configure this value to 2500.

>> $sitecol = Get-SPSite http://mossserver:8000

>>$sitecol.WebApplication. MaxItemsPerThrottledOperationWarningLevel

= 2500

3000
List View Lookup Threshold Having a lot of lookup in a list also decreases the list performance. So this is the maximum no of lookups that a list can have. Having more lookups than this value mean the list is throttled. 6
Object Model Override This will allow the developers to override the property and ignore the throttling. E.g. SPQuery.RequestThrottleOverride & SPSiteDataQuery.RequestThrottleOverride will enable programmers to ignore the “throttling behavior” and get more items from the list than “List View Threshold”.

As administrator of SharePoint 2010, you have commands available through the Power Shell which can restrict a specific list from being queried through this model, thus users code can no longer ignore the “throttling” and the throttling Threshold value will be applied.

Yes
Daily Time Window for Large Queries This will allow the third party application (using super user or administrator credentials) to query the Large SharePoint 2010 List during off business time. Disabled

 

So with the above things in mind, how the following code (Retrieve all students from the “Student” list), will behave:-

image

Property Code Run in Context of Normal List User A (But Not SharePoint Administrator) Code Run in Context of User B (SharePoint Administrator)
List Items Count < “List View Threshold “ (5000),

i.e. <5,000

Code will run fine and return the required result. Code will run fine and return the required result.
List Item Count > “Warning Level” (2000)

i.e. >2000 but < 5000

No exception is thrown, code runs fine No Exception is thrown, code runs fine.
List Items Count > “List View Threshold”(5000) But Less than “List View Threshold for Auditors and Administrators” (20,000),

i.e. >5,000 but < 20,000

A Expensive Query Exception is thrown No Exception is thrown, and the code will return the required result.
List Items Count > “List View Threshold for Auditors and Administrators”(20,000),

i.e. >20,000

A Expensive Query Exception is thrown A Expensive Query Exception is thrown
During Time of Daily Time Window for Large Queries. Query threshold not applied, query runs fine even if the threshold limit is exceeded. Query threshold not applied, query runs fine even if the threshold limit is exceeded.
Object Model Override = true and RequestThrottleOverride is overridden Exception thrown if list is throttled, this property cannot be overridden by a normal user. No exception thrown, even if the list is throttled (i.e. Items Count >20,000)

 

Some Useful Power Shell Commands

How to? Example
Set the maximum threshold warning value for the web application  $sitecol = Get-SPSite http://mossserver:8000

$sitecol.WebApplication. MaxItemsPerThrottledOperationWarningLevel

= 2500

This command will save all the list possible commands to a file on C:\ drive. $sitecol.RootWeb.Lists | select * >> c:\listcmd.txt
Get a reference to the list $list = $sitecol.RootWeb.Lists[“Student”]
Is List Throttled $list.IsThrottled
Is Throttling on list is enabled or not. $list.EnableThrottling
Returns the maximum throttled threshold value (for administrator) $sitecol.WebApplication.MaxItemsPerThrottledOperation
Return the maximum throttled threshold value (for normal user). $sitecol.WebApplication.MaxItemsPerThrottledOperationOverride
Maximum lookup field allowed in a list. $sitecol.WebApplication.MaxQueryLookupFields

 

Briefly, Throttling allows realistic limit on the number of items that can be or should be queried from a SharePoint 2010 List. Although you can store the million of item in a SharePoint list, but the query operation will become slower as the size of the list grows. By allowing throttling, SharePoint 2010 has now help developers & especially Farm Administrators to control the large list & large list queries so that the performance of the whole SharePoint farm doesn’t decrease.

Posted in Sharepoint 2010, Sharepoint Foundation 2010, Throttling List | Tagged: | 3 Comments »

New Features of List in SharePoint 2010 (Part 1/2)

Posted by Ali Khan on December 20, 2009

In this post, I will describe some of the new things introduced with lists in SharePoint 2010.

Some of these things are

1. Referential Integrity:-

As you know, with SharePoint 2007 we can create relationship between lists using Lookup field. But now, List in SharePoint 2010 also supports Referential Integrity with another list. So if you have two lists Student and Department, you can create a referential integrity constraint (Cascade Delete or Restrict Delete) between them.

  1. Cascade Delete: Means if item in the parent list is deleted all the associated items in the child list will also be deleted (just like in SQL Server)
  2. Restrict Delete: If an item in parent list is associated to items in the child list, then this item in parent list cannot be deleted unless its association with all the items from the child list is removed.

Here in below example, I have created two List “Student” & “Department”. And now I am creating a relationship between “Student” and “Department”. For this I have to create a column in “Student” list. See the diagram below. (Also see the referential integrity constraint between the two list set to “Restrict Delete”, which means the “Department” cannot be deleted if there are one or more “Student” related to it, just like between any two SQL tables).

image

 

2. Projected Fields in Lists:-

These are fields from the parent list which will appear in the view of the child list. These are additional fields from the parent list to be shown in the child list. E.g. from the above diagram, Department Location from the department will be shown in the student list. These fields are NOT saved in the child list (Student) and will be only shown in the child list. See the diagram below. Here the “Department Location” is a “Project Field” from the “Department” list to be shown in the “Student” list, but it is not saved in the “Student” list.

image

image

3. Unique Columns:-

You can create unique column (meaning the column will hold the unique data) inside a list in SharePoint 2010. The unique column MUST be indexed. So while creating the unique column, SharePoint 2010 will ask you to index the Unique Column. E.g. Student “Registration No” can be a unique column in the “Student” list. You can also make any existing column as unique column provided it has unique data for all the list items.

4. JOIN and Querying Data from Two Lists:-

Developers can query the SharePoint 2010 List using CAML and LINQ to SharePoint and select fields from two different lists as shown in the code below. Here in the below code ( LINQ To SharePoint), I have retrieved all the “Students” for the Department “Computer Science”.

Note: – In order to use LINQ to SharePoint you have to generate the “SharePoint Context” from the SPMetal tool (now comes as a part of SharePoint 2010), which is located at the following directory. (“C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN”). Here is syntax to generate your Context.cs file.

SPMetal /web:http://mossserver:8000 /namespace:SPTeamSite /code:SPTeamSite.cs

After this create a new project in VS2010, add the reference to Microsoft.SharePoint.Linq.dll & Microsoft.SharePoint.dll located at the following directory. (“C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI”). Also add the SPTeamSite.cs file generated from the SPMetal tool. See the diagram below.

image

Now here is the code to retrieve all the “Students” of a particular “Department”.

image

image

Lists in SharePoint 2010 have a lot more to offer. I will do more posting on the new features of Lists in SharePoint 2010 as I learn more about it.

Cheers 🙂

Posted in Sharepoint 2010, Sharepoint Foundation 2010 | Tagged: | 2 Comments »

Sharepoint 2010 Beta Developer Training Kit

Posted by Ali Khan on December 15, 2009

Brief Description
Guidance that provides developers with advanced guidance on how to develop for SharePoint

Overview
The SharePoint 2010 Beta Developer Training Kit provides developers with deep guidance on how to develop for SharePoint 2010. Through PowerPoint decks, Hands-On Labs, Source Code, and Instructor-Led Videos, the developer kit walks you through an array of important developer topics–including Developer Roadmap, Visual Studio tooling, Workflow, Business Connectivity Services, and much, much more.

System Requirements
Supported Operating Systems: Windows 7; Windows Server 2008 R2
To use the guidance properly, you’ll need to have SharePoint Server 2010 Beta and Visual Studio 2010 Beta installed on a Windows operating system. Supported Operating Systems: Windows Server 2008 R2 (64 bit) and Windows 7 (64 bit).

Quick Details
File Name: SharePoint2010Developer.exe
Version: 1.0
Date Published: 12/14/2009
Language: English
Download Size: 41.9 MB

Source:- http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=bfd1603b-7550-4b8e-be85-4215a5069b90

Posted in Sharepoint 2010, Sharepoint Foundation 2010 | Leave a Comment »

Microsoft SharePoint Foundation 2010 (Beta) Management Pack

Posted by Ali Khan on December 3, 2009

Brief Description
A System Center Management Pack for Microsoft SharePoint Foundation 2010 Beta.

Overview

This System Center Management Pack is for Mi​crosoft SharePoint Foundation 2010 Beta.

This Management Pack monitors important Events, Performance Counters, Services, and SharePoint Health Analyzer Rules found in SharePoint Foundation 2010 Beta.
This Management Pack let’s Operators know when incidents occur which could endanger the health of the SharePoint farm; notifications can either be:

•Components displayed in a red unhealthy status in the System Center Operations Manager diagram view.
•Alerts sent directly to the Operator (this notification happens only for critical incidents).

Quick Details
File Name: Microsoft SharePoint Foundation 2010 Beta SC OpsMgr 2007 MP ENG.msi
Version: 1
Date Published: 11/17/2009
Language: English
Download Size: 2.0 MB

Posted in Sharepoint 2010, Sharepoint Foundation 2010 | 1 Comment »

Upgrade and From WSS 3.0 to Sharepoint Foundation 2010

Posted by Ali Khan on December 3, 2009

Here is a link that discuss the different upgrade approcaches WSS 3.0 to Sharepoint Foundation 2010.

Source:- http://technet.microsoft.com/en-us/sharepoint/ee517215.aspx

Posted in Sharepoint 2010, Sharepoint Foundation 2010, Windows Sharepoint Services 3.0, WSS 3.0 | 1 Comment »

SharePoint Foundation 2010 Beta

Posted by Ali Khan on December 3, 2009

Brief Description This download contains an installable version of Microsoft SharePoint Foundation 2010 Beta, that can be used to assess and test the new functionality in this release.

Quick Details
File Name: SharePoint.exe
Version: 1
Date Published: 11/17/2009
Language: English
Download Size: 167.5 MB

 

Overview

This download contains an installable version of Microsoft SharePoint Foundation 2010 Beta that can be used to assess and test the new functionality in this release. SharePoint Foundation 2010 is the new version of Windows SharePoint Services.

A Microsoft System Center Operations Manager Management Pack is available for Microsoft SharePoint Foundation 2010 Beta. This Management Pack monitors important Events, Performance Counters, Services, and SharePoint Health Analyzer Rules found in SharePoint 2010 Foundation. You can find this Management Pack available for download here.

System Requirements

  • Supported Operating Systems: Windows Server 2008 R2; Windows Server 2008 R2 Enterprise; Windows Server 2008 R2 Standard; Windows Server 2008 Service Pack 2

Windows Server 2008

Posted in Sharepoint 2010, Sharepoint Foundation 2010 | Leave a Comment »