August 3, 2020

Am a keen follower of Microsoft's SharePoint Blog and proud to provide this direct from the Microsoft Tech Community:

Is your SharePoint 2013 or 2016 farms Distributed Cache services Healthy? If not you might need to patch. One way to validate your Distributed Cache service is healthy is to pull some ULS logs from one of the Distributed cache servers in the farm.



Using ULSViewer, Filter your ULS log files where Category equals DistributedCache, if you see something like the screenshot below. Then your Distributed cache is not healthy and should patch your farm using the steps in this article.


EventId Found – air4c, air4d, agyfw, air4c, air38, air39





Steps for Patching Distributed cache

Patching the distributed cache service on your SharePoint farm will cause user experience to be interrupted a bit and its recommended to be performed during a maintenance window. But It can be performed during production if its all ready down in some cases.


Step 1 – Shut down the Distributed Cache service on one of the distributed cache servers in your farm.

Run the following PowerShell command to stop the distributed cache on the server at a SharePoint command prompt.


Stop-SPDistributedCacheServiceInstance -Graceful


Step 2 – Patch AppFabric 1.1 on the one server you stopped the Distributed Cache service on. Patch the server with CU7 found in the following article where you can download it –


Step 3 – Update the “DistributedCacheService.exe.config” file to run garbage collection process in the background on each Distributed Cache server. 


File location – C:Program FilesAppFabric 1.1 for Windows ServerDistributedCacheService.exe.config


Update the file with the section below, see screen shot below – Make sure you put it in the right section or it will not work correctly.




   <add key=”backgroundGC” value=”true”/>






Step 4 – Repeat steps 1 through 3 on the next distributed cache sever in the farm, repeat these steps until you have patched all the Distributed cache servers using these steps. Once you have them all patched, move on to Step 5.


Step 5 – Fine-tune the Distributed Cache service by using a Windows PowerShell script found in this Microsoft article near the bottom in the section called:

Fine-tune the Distributed Cache service by using a Windows PowerShell script


Run the script found in the article on one of your SharePoint servers in the farm. This only has to be done once.


Note – there is a section for SharePoint 2013 and 2016 in the Microsoft article – Use the section that matches your farm.




Step 6 – Start the Distributed cache service using the below PowerShell script in a SharePoint PowerShell command prompt on one of the Distributed cache servers.


$instanceName =”SPDistributedCacheService Name=AppFabricCachingService”

$serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($ -eq $env:computername}



Step 7 – Verify the health of the Distributed cache server you started in Step 6 using the below PowerShell commands, Do not go to Step 8 until the server shows UP. You might have to wait a bit for it to come up, its usually slow on the first server to start up.






NOTE – If you have servers listed as Down, try starting the Distributed cache service in Central admin and re-run the above commands to verify it came up.



 Step 8 – Repeat Step 6 through 7 on the rest of the Distributed cache servers until they are all started. 


 Step 9 – Once all the servers are up, check their health one more time to make sure they are all UP.






The above is kindly provided by the Microsoft Tech Community!

You May Also Like…