Thursday, March 24, 2016

Distributed Cache on SharePoint Server 2013

Originally developed as the AppFabric Cache for the “Cloud” (Microsoft Azure), this product has been developed for the On=Premise systems of Microsoft SharePoint 2013 and called the distributed cache.

The distributed cache can be deployed in 2 different ways:

  • Dedicated Mode
  • Co-located Mode
Dedicated Mode: This involves running only this service on a SharePoint Application server and disabling all other services. If this mode is used, it is advisable to have at least two servers for distributed cache for redundancy purposes.
Co-located Mode: The distributed cache runs along with all other service applications on the application server(s). This is the recommended mode for deploying Distributed Cache.

Notes on Memory used by Distributed Cache:

  • By default 10% of the total physical memory is allocated to Distributed Cache.
  • The memory size for the distributed cache on every server that has distributed cache enabled has to be the same size. [Be very aware of this because if the application servers have different sized RAM, this will require adjustment based on the default SharePoint 2013 installation behavior noted in the previous point).
  • 50% of the memory for storage and the other 50% to manage the memory.
  • Adding more memory to the server does not increase the memory that was initially allocated to the server on install and will require adjusting if more memory is required. Remember to do any adjustments on all servers running the distributed cache service.
  • The memory allocated to distributed cache cannot exceed 16GB. Exceeding this size causes issues in the entire farm and is a known Microsoft issue. So if more memory is required, the only option is to add another server and run distributed cache on it. Also remember that if the server has 16GB of total memory to leave at least 2GB for other services in the dedicated mode and a judicious amount for the co-located mode.

Operations on Distributed Cache

Changing memory Allocation:

  1. Stop the service from Central Administration
  2. Using Power shell with the SP add-on : Update-SPDistributedCacheSize –CacheSizeInMB CacheSize
  3. Start the service via Central Admin

Change the service account

There are times when the distributed cache service account needs to be changed. This is easily accomplished in 2 steps.
  1. Create the new account in SharePoint in Central Administration
  2. Using PowerShell, run the following script:
$farm = Get-SPFarm
$cacheService = $farm.Services | where {$_.Name -eq "AppFabricCachingService"}
$accnt = Get-SPManagedAccount -Identity domain_name\user_name
$cacheService.ProcessIdentity.CurrentIdentityType = "SpecificUser"
$cacheService.ProcessIdentity.ManagedAccount = $accnt


Graceful shutdown of the Distributed Cache Service

There are times when a server running in the distributed cache cluster requires maintenance. If the service is shutdown, all the data in the cache is lost. Gracefully shutting the service down ensures that any data in the cache is moved to another cache host in the farm. (A stopped service can be started at any time and has no pre-requisites other than the amount of memory being allocated to the service is the same as other servers in the distributed cache cluster)
At the Powershell prompt: Stop-SPDistributedCacheServiceInstance -Graceful


Repair a cache host

The Distributed Cache Service sometimes malfunctions. [Evidence of a malfunctioning distributed cache will appear in the Health Rules or users will notice when Newsfeeds start reporting errors].
Start Powershell with the SharePoint addons.

Get-SPServiceInstance [Note the GUID in the ID property of the server being repaired]
$s = Get-SPServiceInstance GUID
Add-SPDistributedCacheServiceInstance (to reinstall and start the distributed cache service)

Monitoring Distributed Cache

The distributed cache can be monitored using PerfMon. The SharePoint Distributed Cache Counters are:

Cache Data Transferred Per Sec
Cache Hit Count
Cache Hit Ratio
Cache Miss Count
Cache Read Requests per sec
Cache Write Requests per sec
Total Cache Read Requests
Total Cache Write Requests

If you know of anymore must haves for Distributed Cache please let me know or put them in the comments.

This blog was originally posted in July 2014 on

Friday, February 5, 2016

SharePoint 2016 Preview – Installation Overview


Microsoft makes installation of application servers as easy as possible and the SharePoint 2016 Preview is no exception. This blog shows the step by step installation of the product.



Hardware requirements are similar to SharePoint 2013. Software requirements are Windows Server 2012 R2 (or Windows Server 2016 Preview) and SQL Server 2014 (or SQL Server 2016). I have used Windows Server 2012 R2 for the SharePoint installation and SharePoint 2012R2 for the database server which is running Microsoft SQL Server 2014. There is one other prerequisite that is required which is not automatically downloaded and that is the Microsoft ODBC Driver 11 for SQL Server which can be downloaded from com/en-us/download/details.aspx?id=3643



Log into the SharePoint server using Setup user account. Mount the SharePoint 2016 Preview iso as a drive.

Choose Install software prerequistes.

Click on the box to accept the License Agreement(s) and click on Next

The Product Preparation tool dialog box opens up.

Click on Next. [Note the third item – Microsoft ODBC Driver 11 for SQL server. The Product preparation tool will fail on this item unless it is downloaded and installed in advance. This should be a non-issue by the RTM version]

Once the tool completes, click on Finish to restart the server.

Login to the server and bring up the installation screen again.

Since all the prerequisites have been installed, select Install SharePoint Server. After a brief wait while the necessary files are gathered,

Enter the product key and click Next. [Note the product key shown is valid for 180 days after installation].

Accept the agreement and click on Continue

An opportunity is provided to choose file locations. These are the defaults which I accepted. Click Install Now.

The installation starts and a progress bar gives the progress of the installation.

On completion, the following screen pops up

If you are installing multiple servers, uncheck the Run the SharePoint Configuration Wizard now and then click on Close. If not, click on Close.