Wednesday, May 1, 2013

SharePoint 2013: Distributed Cache Hosts in Farm Exceeds the Recommended Value

I am glad I am learning things simply by looking at the Health Issues in our new production environment. This morning I saw and interesting one stating that "The number of Distributed Cache hosts in the farm exceeds the recommended value."

Reviewing the issue showed the following:



 
The explanation, which is also the cause, stated that every machine on the farm has the Distributed Cache service started. Although this occurs simply by installing SharePoint 2013 and adding servers to the farm, I didn't realize that not every server should be running this service. I associated the Distributed Cache with AppFabric in my head and just assumed that each server needed it.
 
The summary of the problem is stated as "On a farm with four or more servers, you must not start the Distributed Cache service on all servers on the farm. If you configure all servers as cache hosts, you may experience reliability and performance problems in the farm." (Reference here)
 
It turns out that you actually need to remove the service from the servers that shouldn't run it - not stop it - actually remove it. This can be peformed using the SharePoint PowerShell cmdlet Remove-SPDistributedCacheServiceInstance :
 

You simply run this command on each server that doesn't need to run the Distributed Cache service. There is no output from the cmdlet but now when you review the Services on Server for the selected server, the Distributed Cache Host is no longer listed:



Since it not recommended to run on an application server running Excel Services, I removed it from that one. I also removed it from my main search application server.

I recommend reviewing Plan for feeds and the Distributed Cache service in SharePoint Server 2013 as well as the other related material linked within that post.



2 comments:

  1. Hi Steve,

    If you just use Remove-SPDistributedCacheServiceInstance and your server contains cache data this data will be lost so the recommended way to this is:
    Stop-SPDistributedCacheServiceInstance -Graceful
    Remove-SPDistributedCacheServiceInstance

    As described here:
    http://technet.microsoft.com/en-us/library/jj219613.aspx

    ReplyDelete