Planning and Configuring Distributed Cache Service || Part 2


Hi All,

As per the previous article, i have tried to create the understanding for Distributed Cache service : Understanding, Planning and Configuring Distributed Cache Service

In this current article will try to see with the planning and configuration of the DCS.

Planning & Capacity analysis of Distributed Cache Service:

At the time of SharePoint Installation , Distributed Cache service is by default assigned 10% of the total physical memory on the server. Distributed Cache service uses half (5% of total physical memory) of that memory allocation for data storage i.e. Cache Size, and the other half of that memory allocation is used for memory management overhead. When the cached data grows, Distributed Cache service uses the entire 10% of the allocated memory.

Cases in which Distributed Cache service memory allocation should be increased:

  • When physical memory is added to the server. Distributed Cache service will not recalculate the 10% memory allocation automatically, so Distributed Cache Services memory allocation have to be increased manually in case of  increase in total physical memory on the server.

 

  • Example to calculate memory assigned to Distributed Cache service when Server has a collocated Distributed Cache server.

1.    Determine the total physical memory on the server. For this example, we have 160 GB as the total physical memory available on the server.

2.    10% of the total physical memory is 16 GB .Reserve 2 GB of memory for other processes and services that are running on the cache host. For example, 16 GB – 2 GB = 14 GB. This remaining memory is allocated to the Distributed Cache service.

3.    Take half of the remaining memory, and convert it to MB. For example, 14 GB/2 = 7 GB or 7168 MB. This is the cache size of the Distributed Cache service.

4.    Use the following procedure to update the memory allocation accordingly.

For dedicated Distributed Cache service below method can be used to determine the cache size:Dstributed Cache Service

Configuring Distributed Cache

Collocated Mode: In normal or default circumstances distributed cache runs in a collocated mode and it require no extra configuration.

1) Installation of all pre-requisites of SharePoint 2013 are complete.

2) Install SharePoint Server 2013

3) Distributed Cache required on all servers in the farm

4) Use the SharePoint Products Configuration Wizard, psconfig.exe or PowerShell cmdlets.

Dedicated mode or hybrid mode: If you need a separate cache cluster, or a set up in which some computer act as a Cache host i.e Hybrid , distributed cache can be set up using powershell command , or you can run PSConfig.exe with the /skipRegisterAsDistributedCachehost flag on all servers that are not cache hosts.

1) Installation of all pre-requisites of SharePoint 2013 are complete.
2) Install SharePoint Server 2013
3) Distributed Cache is not required on all servers in the farm
4) Use psconfig.exe or PowerShell cmdlets to configure SharePoint and use command with the /skipRegisterAsDistributedCachehost parameter on all servers that are not cache hosts.
and
5) Use psconfig.exe or PowerShell cmdlets to configure SharePoint and use command without the /skipRegisterAsDistributedCachehost parameter on all servers that are cache hosts.

Changing a Non-Cache Host To a Cache-Host

At a later point of time in a farm if you need to change non cache host to cache host use the below command:

1) Add-SPDistributedCacheServiceInstance cmdlet on the cache host being added
2) Perform post configuration rechecks

Changing a Cache Host To a Non-Cache-Host

At a later point of time in a farm if you need to change cache host to non cache host due to any reason use the below command:

1) Remove-SPPDistributedCacheServiceInstance cmdlet  on the cache host changing to a non-cache host
2) Perform post configuration rechecks

Repairing a Cache Host

During installation, configuration, or maintenance activities, the Distributed Cache service may enter a non-functioning state. Report of issue in Distributed Cache service will appear in Health Rules in Central Administration or when users use features in SharePoint Server 2013 that rely on the Distributed Cache. Use the below command to restore to functioning state :

1)Run Get-SPServiceInstance to list all services for all servers in the server farm
Note the GUID from the ID property of the Distributed Cache service on the server you are repairing
2) Run the PowerShell code below
$service = get-spserviceinstance GUID
$service.delete()
where GUID is the GUID of the Distributed Cache service running on the server which has to be repaired.
3) Run Add-SPDistributedCacheServiceInstance to reinstall and start the Distributed Cache service on the cache host you are repairing.

Update a Cache Host Size

Whenever you want to increase the memory allocation of the Cache Host above the default requirement :

1) Stop the Distributed Cache service on all cache hosts on Central administration in Services on Server page.
2) Run the Update-SPDistributedCacheSize -CacheSizeInMB <CacheSize> cmdlet on any cache host
3) Restart the Distributed Cache service on all cache hosts on Central administration in Services on Server page.

Graceful Shutdown a Cache Server

There is only one copy of any item in the cache, So it is very important to carefully add and remove servers from the Distributed Cache cluster. The “graceful shut down” of a Cache Server in a Cache Cluster transfers any cache data to another Cache Server in the Cache Cluster from the server being removed.

To modify , repair or remove stop the distributed cache service gracefully.
Stop-SPDistributedCacheServiceInstance –Graceful

If you liked this post, do like on Facebook at : https://www.facebook.com/Ashishsharepointblog

Feel free to Rate and provide feedback if you find post useful

Hope this help
Ashi

To know about latest service pack and update on SharePoint. Please refer: Link

This entry was posted in SharePoint 2013, SQLServerPedia, Uncategorized and tagged , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s