In SharePoint Server 2013, Microsoft managed to dramatically improve performance by storing objects and data across servers to enable the accelerated execution of many different types of requests and operations. The Distributed Cache service, which is built on Windows Server AppFabric Cache, is set to run in a collocated mode on all SharePoint 2013 Servers by default, using up to 10% of the server’s total physical memory.
It’s essential for maintaining the large amounts of information on your SharePoint Server, ensuring that the information is fresh and readily available for the end user.
Improving SharePoint 2013 performance relies on the provision of caching functionalities to the following features:
- Claims-based authentication
- Newsfeeds, micro blogging and conversations
- OneNote client access
- Security trimming
- Page load performance
Caching functionalities, provided by the Distributed Cache service, enable the SharePoint features listed above to quickly retrieve data without any dependency on databases stored in SQL Server, as everything is stored in memory.
Distributed Cache Guidelines
While the administrator is not required to take any initial actions to set up Distributed Cache, it does have many extensibility/configurability points, and the cache cluster spans all cache hosts, saving data on each cache host without duplicating or copying data on other cache hosts in the cache cluster.
It is possible to set up a dedicated cache cluster, repair or reconfigure an existing cache cluster or host, change a non-cache host to a cache host and vice versa, or reconfigure the memory allocation.
Memory allocation for cache hosts can be increased or decreased, or you can easily increase available resources for the Distributed Cache service, as your SharePoint Server 2013 farm grows, by adding a new server to the farm. Distributed Cache service can be deployed in dedicated mode or collocated mode but, when planning implementation, Microsoft recommends deployment in dedicated mode.
Microsoft also recommends creating separate AppFabric cache clusters for supporting custom applications, running them on separate servers from your SharePoint Server 2013 farm dedicated servers.
Distributed Cache Service Planning
Your choice of architecture and memory allocation for the Distributed Cache service can affect its performance significantly. In order to maintain a healthy service with a low risk of disrupting dependent services, the following steps should be taken:
- Perform capacity planning – identify the number of servers, memory requirements, and topology based on estimated workload and amount of usage.
- Plan memory usage and configuration – following your capacity planning, use memory related tasks to identify which configuration works best for your server farm.
Total memory specifications on all cache cluster servers must match exactly and, while the maximum amount of memory that can be allocated to each cache host in the server farm is 16GB, you must plan to reconfigure the memory allocation of the cache size for servers with more than 320GB of memory.
Distributed Cache Service Configuration
When making any configuration or service changes to the Distributed Cache service, it is important to note that the service can end up in a non-functioning or unrecoverable state and, in some cases, your server farm might need to be rebuilt.
In order to avoid this situation, Microsoft recommends that you avoid administering the AppFabric Caching Service from the Services window in Administrative Tools in Control Panel. You must also avoid using the applications in the folder name AppFabric for Windows Server on the Start menu.
No extra configuration is required in normal or default circumstances, as Distributed Cache will be running in collocated mode. However, if you need a separate cache cluster or a cache host computer, then you can set up Distributed Cache using psconfig.exe or PowerShell cmdlets.
Distributed Cache Service Management
To investigate the Distributed Cache cluster, open SharePoint Management Shell as admin where you can run the Use-CacheCluster and Get-CacheHost PowerShell commands to identify all existing cache hosts, their ports, service status and version info.
To run Distributed Cache service on only one server, you need to stop the service on all servers using PowerShell, and/or via Central Administration. You then remove the selected servers from the Distributed Cache cluster by logging on to each server, and running SharePoint Management Shell as admin.
When the Distributed Cache service is restarted, you can change the service account using the change domainspdistributedcache parameter. Distributed Cache service can be run either on a physical or virtual server. However, when using virtualization, it is important not to use dynamic memory on SharePoint 2013 Servers, as the memory allocation must be fixed.
For troubleshooting Distributed Cache Service in SharePoint 2013, you can use the steps found here, but an orphan entry might be generated in the configuration database, requiring a reinstall for the server that is NOK, which can be added back to the farm with a different name.
Distributed Cache Service has helped improve performance in SharePoint 2013. With a little configuration, you can optimize your environment even further.