Wednesday, November 7, 2012

Sharepoint 2010 Capacity Management - I


Limits and boundaries


The below table gives a detailed information on the guidelines for acceptable performance for objects in SharePoint. In this section I am focusing on the Web applications, Web server and application servers, Content databases and Site collections. Acceptable performance means that the system as tested can support that number of objects, but that the number cannot be exceeded without some decrease in performance or a reduction in the value of related limits.

• Boundaries: Static limits that cannot be exceeded by design

• Thresholds: Configurable limits that can be exceeded to accommodate specific requirements

• Supported limits: Configurable limits that have been set by default to a tested value

Limits by hierarchy

This section provides limits sorted by the logical hierarchy of a SharePoint Server 2010 farm.

Web application limits

The following table lists the recommended guidelines for Web applications.

Limit
Maximum value
Limit type
Notes
Content database
300 per Web application
Supported
With 300 content databases per Web application, end user operations such as opening the site or site collections are not affected. But administrative operations such as creating a new site collection will experience decrease in performance. We recommend that you use Windows PowerShell to manage the Web application when a large number of content databases are present, because the management interface becomes slow and difficult to navigate.
Zone
5 per Web application
Boundary
The number of zones defined for a farm is hard-coded to 5. Zones include Default, Intranet, Extranet, Internet, and custom.
Managed path
20 per Web application
Supported
Managed paths are cached on the Web server, and CPU resources are used to process incoming requests against the managed path list.
Exceeding 20 managed paths per Web application adds more load to the Web server for each request.
If you plan to exceed twenty managed paths in a given Web application, we recommend that you test for acceptable system performance.
Solution cache size
300 MB per Web application
Threshold
The solution cache allows the InfoPath Forms service to hold solutions in cache in order to speed up retrieval of the solutions. If the cache size is exceeded, solutions are retrieved from disk, which may slow down response times. You can configure the size of the solution cache by using the Windows PowerShell cmdlet Set-SPInfoPathFormsService.
Site collection
250,000 per Web application
Supported
The maximum recommended number of site collections per Web application is 250,000.
Note that this limit is affected by other factors that might reduce the effective number of site collections that can be supported by a given Web application. Care must be exercised to avoid exceeding supported limits when a container object, such as a content database, contains a large number of other objects.
For example, in a farm that contains a large number of Web applications, the total number of site collections might reach a number that cannot effectively be supported by farm resources. This can be true even when both the number of Web applications per farm and the number of site collections per Web application fall within their supported limits.
Similarly, if a farm contains a smaller total number of content databases, each of which contains a large number of site collections, farm performance might be adversely affected long before the supported limit for the number of site collections is reached.
The following case illustrates this point.
Farm A contains a Web application that has 200 content databases, a supported configuration. If each of these content databases contains 200 site collections, the total number of site collections in the Web application will be 40,000, which falls within supported limits. However, if each content database contains 2,000 site collections, even though this number is supported for a content database, the total number of site collections in the Web application will be 400,000, which exceeds the limit for the number of site collections per Web application.

Web server and application server limits

The following table lists the recommended guidelines for Web servers on the farm. 

Limit
Maximum value
Limit type
Notes
Application pools
10 per Web server
Supported
The maximum number is determined by hardware capabilities.
This limit is dependent largely upon:
·         The amount of RAM allocated to the Web servers
·         The workload that the farm is serving, that is, the user base and the usage characteristics (a single highly active application pools can reach 10 GB or more)

Content database limits

The following table lists the recommended guidelines for content databases. 

Limit
Maximum value
Limit type
Notes
Content database size (general usage scenarios)
200 GB per content database
Supported
We strongly recommended limiting the size of content databases to 200 GB, except when the circumstances in the following rows in this table apply.
If you are using Remote BLOB Storage (RBS), the total volume of remote BLOB storage and metadata in the content database must not exceed this limit.
Content database size (all usage scenarios)
4 TB per content database
Supported
Content databases of up to 4 TB are supported when the following requirements are met:
·         Disk sub-system performance of 0.25 IOPs per GB. 2 IIOPs per GB is recommended for optimal performance.
·         You must have developed plans for high availability, disaster recovery, future capacity, and performance testing.
You should also carefully consider the following factors:
·         Requirements for backup and restore may not be met by the native SharePoint Server 2010 backup for content databases larger than 200 GB. It is recommended to evaluate and test SharePoint Server 2010 backup and alternative backup solutions to determine the best solution for your specific environment.
·         It is strongly recommended to have proactive skilled administrator management of the SharePoint Server 2010 and SQL Server installations.
·         The complexity of customizations and configurations on SharePoint Server 2010 may necessitate refactoring (or splitting) of data into multiple content databases. Seek advice from a skilled professional architect and perform testing to determine the optimum content database size for your implementation. Examples of complexity may include custom code deployments, use of more than 20 columns in property promotion, or features listed as not to be used in the over 4 TB section below.
·         Refactoring of site collections allows for scale out of a SharePoint Server 2010 implementation across multiple content databases. This permits SharePoint Server 2010 implementations to scale indefinitely. This refactoring will be easier and faster when content databases are less than 200 GB.
It is suggested that for ease of backup and restore that individual site collections within a content database be limited to 100 GB.
Content database size (document archive scenario)
No explicit content database limit
Supported
Content databases with no explicit size limit for use in document archive scenarios are supported when the following requirements are met:
·         You must meet all requirements from the “Content database size (all usage scenarios)” limit earlier in this table, and you should ensure that you have carefully considered all the factors discussed in the Notes field of that limit.
·         SharePoint Server 2010 sites must be based on Document Center or Records Center site templates.
·         Less than 5% of the content in the content database is accessed each month on average, and less than 1% of content is modified or written each month on average.
·         Do not use alerts, workflows, link fix-ups, or item level security on any SharePoint Server 2010 objects in the content database.
Content database items
60 million items including documents and list items
Supported
The largest number of items per content database that has been tested on SharePoint Server 2010 is 60 million items, including documents and list items. If you plan to store more than 60 million items in SharePoint Server 2010, you must deploy multiple content databases.
Site collections per content database
2,000 recommended
5,000 maximum
Supported
We strongly recommended limiting the number of site collections in a content database to 2,000. However, up to 5,000 site collections in a database are supported.
These limits relate to speed of upgrade. The larger the number of site collections in a database, the slower the upgrade.
The limit on the number of site collections in a database is subordinate to the limit on the size of a content database that has more than one site collection (200 GB). Therefore, as the number of site collections in a database increases, the average size of the site collections it contains must decrease.
Exceeding the 2,000 site collection limit puts you at risk of longer downtimes during upgrades. If you plan to exceed 2,000 site collections, we recommend that you have a clear upgrade strategy, and obtain additional hardware to speed up upgrades and software updates that affect databases.
To set the warning level for the number of sites in a content database, use the Windows PowerShell cmdlet Set-SPContentDatabase with the -WarningSiteCount parameter.
Remote BLOB Storage (RBS) storage subsystem on Network Attached Storage (NAS)
Time to first byte of any response from the NAS cannot exceed 20 milliseconds

Boundary
When SharePoint Server 2010 is configured to use RBS, and the BLOBs reside on NAS storage, consider the following boundary.
From the time that SharePoint Server 2010 requests a BLOB, until it receives the first byte from the NAS, no more than 20 milliseconds can pass.

Site collection limits

The following table lists the recommended guidelines for site collections. 

Limit
Maximum value
Limit type
Notes
Web site
250,000 per site collection
Supported
The maximum recommended number of sites and subsites is 250,000 sites.
You can create a very large total number of Web sites by nesting subsites. For example, in a shallow hierarchy with 100 sites, each with 1,000 subsites, you would have a total of 100,000 Web sites. Or a deep hierarchy with 100 sites, each with 10 subsite levels would also contain a total of 100,000 Web sites.
Note: Deleting or creating a site or subsite can significantly affect a site’s availability. Access to the site and subsites will be limited while the site is being deleted. Attempting to create many subsites at the same time may also fail.
Site collection size
Maximum size of the content database
Supported
A site collection can be as large as the content database size limit for the applicable usage scenario. In general, we strongly recommend limiting the size of site collections to 100 GB for the following reasons:
·         Certain site collection actions, such as site collection backup/restore or the Windows PowerShell cmdlet Move-SPSite, cause large Microsoft SQL Server operations which can affect performance or fail if other site collections are active in the same database.
·         SharePoint site collection backup and restore is only supported for a maximum site collection size of 100 GB. For larger site collections, the entire content database must be backed up. If multiple site collections larger than 100 GB are contained in a single content database, backup and restore operations can take a long time and are at risk of failure.

Tuesday, November 6, 2012

Pre-Upgrade Check : Cannot Proceed Error Message

Symptoms:

When you try to run the PreUpgradeCheck command, you get the following message:

Pre-upgrade check cannot proceed because the current farm is not joined to a farm, or the farm configuration database is not responding.

Cause:

Probably you don't have the sufficient privileges to run this command.

Resolution:

Run the command prompt using Farm Administrator account or alternatively "Update farm administrator's group" through Central Administration page, by adding the current logged on user.

Monday, November 5, 2012

7 Sharepoint ContentDatabase FAQ's


1. Can we create a site collection in a specific Content Database?

Yes, but you can only do this by using PowerShell using the New-SPSite cmdlet. You can use the                         -ContentDatabase parameter to specify in which Content Database the site collection will be created. 
Make sure that the content database is already created. Else you will get an error saying the content database could not be found.
An alternative would be through Central Administration. But, that is a workaround.

2. If a site collection is outgrowing its content database size; can I add a second Content Database to it?

A SharePoint site collection cannot have more than one content database. If you want to split up your site collection in to multiple site collections, you can do this by exporting and importing subsites, or by using 3rd party tools.

3. How can I get a list of site collections in a Content Database?

Use this powershell command:Get-SPContentDatabase  Name of your Content DB
Get-SPContentDatabase | %{Write-Output "- $($_.Name)”; foreach($site in $_.sites){write-Output $site.url}}

4. Checking the size of my Content Database?

The easiest way to accomplish this is by looking at the database file on your SQL Server.

5. Which all Content Databases are attached to my Web Applications?

Below powershell command will return all Web Applications with their respective Content Databases:               Get-SPWebApplication | %{Write-Output "`n- $($_.url)"; foreach($cd in $_.contentdatabases){Write-Output $cd.name}}

6. How do I move my site collection to another Content Database?

In this case, there are 2 scenarios:
- Move the site collection to another Content Database that is attached to the same Web Application
Move-SPSite cmdlet to move the site collection.
(eg. Move-SPSite sitecollectionURL –DestinationDatabase WSS_Content_DBName)

- Move the site collection to another Content Database that is attached to another Web Application
Backup-SPSite and Restore-SPSite powershell commands

7. Can we use the same Content Database for more than one Web Application?

No, this is not possible. A Content Database can only be attached to a single Web Application.



SPContentDatabase Powershell Commands


New-SPContentDatabase
Creates a new content database and attaches it to the specified Web application.

C:\PS>New-SPContentDatabase "MyDatabase" -DatabaseServer "MyServer" -WebApplication http://sitename
This example creates a new content database for the sitename Web application.

Remove-SPContentDatabase
Deletes a content database.

C:\PS>Get-SPContentDatabase 12345678-90ab-cdef-1234-567890abcdef | Remove-SPContentDatabase
This example deletes the specified content database.

Get-SPContentDatabase
Returns one or more content databases.

C:\PS>Get-SPContentDatabase -webapplication http://sitename
This example returns all content databases used by the sitename Web application.

C:\PS>Get-SPContentDatabase -site http://contoso.com
This example returns the content database that contains the site collection at http://contoso.com.

Set-SPContentDatabase
Sets global properties of a SharePoint content database.

C:\PS>Get-SPContentDatabase http://contoso.com | Set-SPContentDatabase -MaxSiteCount 1
This example sets the MaxSiteCount for the content database that contains contoso.com to 1.

C:\PS>Get-SPContentDatabase -WebApplication http://sitename | Set-SPContentDatabase -WarningSiteCount $null
This example clears the WarningSiteCount for all databases in the sitename Web application.

Mount-SPContentDatabase
Attaches an existing content database to the farm.

C:\PS>Mount-SPContentDatabase "MyDatabase" -DatabaseServer "MyServer" -WebApplication http://sitename
This example mounts an already existing database to the sitename Web application.

Dismount-SPContentDatabase
Detaches a content database from its currently associated Web application.

C:\PS>Dismount-SPContentDatabase 12345678-90ab-cdef-1234-567890abcdef
This example detaches the content database with the GUID 12345678-90ab-cdef-1234-567890abcdef from its current parent Web application.

C:\PS>Get-SPContentDatabase -WebApplication http://sitename | Dismount-SPContentDatabase -WhatIf
This example detaches all content databases from the Web application on port 80 of the local machine. Remove the WhatIf parameter to perform the operation.

How to display detailed Sharepoint errors for faster troubleshooting


Browse to the location where the web.config file is located for your web application.Usually C:\inetpub\wwwroot\wss\VirtualDirectories\80  (port number depend on where you have your web application)

Change these values from
<customErrors mode="On" />
And
CallStack="false"

to

<customErrors mode="Off" />
and
CallStack="true"

Save your web.config file. You will get detailed errors from now on.

Thursday, November 1, 2012

Understanding Sharepoint Managed Paths


When we create Site Collections in Sharepoint web applications, they are created with URL as 

http://servername:port/sites/

To have a specific URL other than /sites we would have to create a Managed Path.

When we create a Managed Path, we have two options:   Explicit Inclusion
                                                                                    Wildcard Inclusion

So what is the difference? I am going to explain you on what is a managed path. Please be my guest ;-)

1) Browse to Central Administration -> Applications Management -> Manage Web Application

2) Choose the web application where you want to implement managed paths.

3) Select Managed Paths from the ribbon




4) I am adding two new paths      - fahadexplicit (for type Explicit inclusion)
                                                 - fahadwildcard (for type Wildcard inclusion)



5) Now browse back to Application Management -> Create Site Collections.

6) You would see your custom Managed paths there.

Explicit Inclusion:

When we are not planning to create further site collections under a specified managed path, then we use this option. Explicit Inclusion Managed paths allows in creation of only one site collection at the exact given URL.
In our case fahadexplicit would be the only site collection that can be created. SharePoint will allow creating only one site collection within this Managed Path.

The URL would be: http://servername:port/fahadexplicit




Wildcard Inclusion:

When we want to create more than one site collection under a specific managed path, we use this option. Wildcard Inclusion Managed Paths allow unlimited site collection to be created under a given URL.
In our case under fahadwildcard, we can create any number of site collections.

The URL of these site collections would be as below:

http://servername:port/fahadwildcard/sitecollection1
http://servername:port/fahadwildcard/sitecollection2
http://servername:port/fahadwildcard/sitecollection3
http://servername:port/fahadwildcard/sitecollection4



and so on.

Configuring Sharepoint BLOB cache settings for a web application


To improve the end user response time a good approach is to configure the BLOB Cache on the SharePoint 2010 Web Front End (WFE) servers. The BLOB cache caches files on the WFEs disk to make it faster for IIS to retrieve the files and return them to the browser. It can also send some HTTP headers telling the browser to cache the file for a certain amount of time. By default, the disk-based BLOB cache is off and must be enabled on the front-end Web server if you want to use it. Use the following procedure to configure disk-based cache settings for a Web application.


1. Click Start, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.

2. In Internet Information Services (IIS) Manager, in the Connections pane, click the plus sign (+) next to the server name that contains the Web application, and then click the plus sign next to Sites to view the Web application or applications that have been created.

3. Right-click the name of the Web application for which you want to configure the disk-based cache, and then click Explore. Windows Explorer opens, with the directories for the selected Web application listed.

4. Right-click web.config, and then click Open.

5. If the Windows dialog box appears, select Select a program from a list of installed programs, and then click OK.

6. In the Open With dialog box, click Notepad, and then click OK.

7. In the web.config Notepad file, find the following line: 
<BlobCache location="" path="\.(gif|jpg|jpeg|jpe|jfif|bmp|dib|tif|tiff|ico|png|wdp|hdp|css|js|asf|avi|flv|m4v|mov|mp3|mp4|mpeg|mpg|rm|rmvb|wma|wmv)$" maxSize="10" enabled="false" />

8. In this line, change the location attribute to specify a directory that has enough space to accommodate the cache size.To change the size of the cache, type a new number for maxSize. The size is expressed in gigabytes (GB), and 10 GB is the default. To enable the BLOB cache, change the enabled attribute, from "false" to "true".Save the Notepad file, and then close it.


Important 

- Before you make changes to the web.config file, make a copy of it by using a different name, so that if a mistake is made in the file, you can restore the original file.
- Verify that you have the following administrative credentials: You must be a member of the Administrators group on the local computer to configure the BLOB cache settings.
- When you save a change to the web.config file, the Web application in Internet Information Services (IIS) 7.0 automatically recycles. This recycling can cause a brief interruption in service to sites contained in that Web application, and users can lose session state.
- It is strongly recommend that you specify a directory that is not on the same drive as where either the server operating system swap files or server log files are stored.
- To add or remove file types from the list of file types to be cached, for the path attribute, modify the regular expression to include or remove the appropriate file extension. If you add file extensions, make sure to separate each file type with a pipe (|), as shown in this line of code. 
- It is recommended that you not set the cache size smaller than 10 GB. When you set the cache size, make sure to specify a number large enough to provide a buffer at least 20 percent bigger than the estimated size of the content that will be stored in the cache.