Saturday 10 May 2014

Distributed Cache Issues - AppFabric Caching Service Terminated unexpectedly

In this post I am trying to provide a short and sweet overview of the distributed cache service in SharePoint 2013, and point you in the right direction for configuration or troubleshooting advice provided by Microsoft in some useful articles.

The distributed cache service is built on the Windows Server AppFabric, this is installed as a pre-requisite for SharePoint 2013.

There are some key indicators that your distributed cache service may not configured to its optimum.

·         Server performance issues (resource usage)
·         SharePoint 2013 slow page loads
·         AppFabric caching service terminating (event viewer errors)


Without going in to great detail the distributed cache service is either required by or is used to improve performance of the below:

·         Authentication
·         Newsfeeds
·         OneNote client access
·         Security Trimming
·         Page load performance


This means that should it be configured incorrectly it can have huge consequences for the performance and usability of your SharePoint 2013 farm.

So how should you configure the distributed cache?

This really depends on your requirements, especially the number of users who will be visiting your SharePoint sites.

From my experience the most common approach is to use the collocated mode, this means running the distributed cache service on SharePoint servers alongside other services (they will form the distributed cache cluster).

This is generally acceptable for organisations with less than 10000 SharePoint users.

In this instance I would recommend setting the distributed cache size limit to an acceptable amount in relation to the amount of RAM on the servers running the distributed cache service.

PowerShell example:

Update-SPDistributedCacheSize -CacheSizeInMB 8000

The total memory allocated to your cache cluster should be a minimum of 8GB, this can be split across multiple servers hence the cluster.

I would recommend allocating a maximum of 40% of any cache servers available RAM to the distributed cache.

More recently I have been involved with an environment where we are running distributed cache in dedicated mode. This is recommended when the number of users is over 10000.

As the name suggests, in dedicated mode there is a layer of SharePoint servers that are dedicated distributed cache servers with all other SharePoint services stopped. This allows their resources to be managed and monitored solely with distributed cache performance in mind.

For more detail please see the below articles

Distributed cache overview and detailed articles: