{"id":1715,"date":"2014-07-09T22:57:54","date_gmt":"2014-07-09T20:57:54","guid":{"rendered":"http:\/\/www.itidea.nl\/?p=1715"},"modified":"2014-07-09T22:57:54","modified_gmt":"2014-07-09T20:57:54","slug":"cloned-vm-slow-due-to-distributed-cache-issues-in-sharepoint-2013","status":"publish","type":"post","link":"https:\/\/www.itidea.nl\/index.php\/cloned-vm-slow-due-to-distributed-cache-issues-in-sharepoint-2013\/","title":{"rendered":"Cloned VM slow due to Distributed Cache issues in SharePoint 2013"},"content":{"rendered":"<p>Recently I worked on a SharePoint 2013 VM for development purposes. This cloned VM contained 16 GB of memory which isn&#8217;t a lot for a SP2013 environment. To be able to work with the VM at a certain speed the Search service was stopped, but that didn&#8217;t speed up things as I was hoping for.<\/p>\n<p>Since we&#8217;re using VMWare the next thing was to check &#8216;Reserve all guest memory (all locked)&#8217;. This worked like a charm, even with the Search enabled, just for a very short time&#8230; I started to monitor the ULS. At once I noticed issues with the Distributed Cache, like<\/p>\n<ul type=\"disc\">\n<li lang=\"en-GB\">There is a temporary failure.      Please retry later. (One or more specified cache servers are unavailable,      which could be caused by busy network or servers. For on-premises cache      clusters, also verify the following conditions. Ensure that security      permission has been granted for this client account, and check that the      AppFabric Caching Service is allowed through the firewall on all cache      hosts. Also the MaxBufferSize on the server must be greater than or equal      to the serialized object size sent from the client.). Additional      Information : The client was trying to communicate with the server :      net.tcp:\/\/&lt;<strong>servername<\/strong>&gt;:22233<\/li>\n<\/ul>\n<p>The servername in the above message wasn&#8217;t the name of the machine I was working on, it still pointed to the machine from which this one is a clone.<\/p>\n<p>Checking the available cache host with PowerShell confirmed this:<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\r\n#Set context to cluster\r\nUse-CacheCluster\r\n#List all cache host services present in cluster\r\nGet-CacheHost\r\n<\/pre>\n<p>The cache host service listed will be the one at the &#8216;old&#8217; server in an UNKNOWN service state, like:<\/p>\n<p>HostName : CachePort \u00a0 \u00a0 \u00a0 \u00a0 Service Name \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0Service Status<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#8212;&#8212;&#8212;&#8212;&#8211; \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>&lt;old_server&gt;:22233 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0AppFabricCachingService \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0UNKNOWN<\/p>\n<p>Since a cache cluster is present the current server can be added as a cache host:<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\r\n#Stop the distributed cache service instance\r\nStop-SPDistributedCacheServiceInstance -Graceful\r\n#add the server as a cache host\r\nAdd-CacheHost -ConnectionString &quot;Data Source=&lt;new_server&gt;;Initial Catalog=SP_CONFIG;Integrated Security=True;Enlist=False&quot; -ProviderType &quot;SPDistributedCacheClusterProvider&quot;\r\n<\/pre>\n<p>The connection string can be found in:<\/p>\n<ul>\n<li>HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\AppFabric\\V1.0\\Configuration<\/li>\n<\/ul>\n<p>There were multiple cloned servers which had to be fixed and sometimes this message appeared:<\/p>\n<blockquote><p>Service is already configured on this host.<\/p><\/blockquote>\n<p>Then run Remove-CacheHost to unconfigure it and proceed with the next steps.<\/p>\n<p>The next step is to register the server as a cache host:<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\r\n#register the server as a cache host\r\nRegister-CacheHost -ConnectionString\u00a0 &quot;Data Source=&lt;new_server&gt;;Initial Catalog=SP_CONFIG;Integrated Security=True;Enlist=False&quot; -ProviderType &quot;SPDistributedCacheClusterProvider&quot;\r\n#Check if cache host is registered successfully\r\nGet-CacheHost\r\n<\/pre>\n<p>Now 2 cache hosts are listed:<\/p>\n<p>HostName : CachePort\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Service Name \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0Service Status<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#8212;&#8212;&#8212;&#8212;&#8211; \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>&lt;old_server&gt;:22233 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0AppFabricCachingService \u00a0 \u00a0 UNKNOWN<\/p>\n<p>&lt;new_server&gt;:22233 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0AppFabricCachingService \u00a0 \u00a0 DOWN<\/p>\n<p>The configuration of the cache cluster has to be exported and adjusted to remove the old server and add the new server:<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\r\n#stop the cluster\r\nStop-CacheCluster\r\n#If result:\r\n#Invalid operation encountered on &lt;old_server&gt;:AppFabricCachingService : Cannot open\r\n#Service Control Manager on computer '&lt;old_server&gt;'. This operation might require other privileges\r\n#and\/or\r\n#No hosts running in cluster\r\n#Just proceed: unable to connect to old_server which makes sense\r\n\r\n#export the cluster configuration so changes can be made\r\nExport-CacheClusterConfig D:\\CODE\\clusterconfig.xml\r\n<\/pre>\n<p>The cluster configuration file needs to be modified. The old server reference has to be deleted, while the new server reference has to be added when registering the cachehost<\/p>\n<p>Part of exported and modified configuration:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;hosts&gt;\r\n&lt;host replicationPort=&quot;22236&quot; arbitrationPort=&quot;22235&quot; clusterPort=&quot;22234&quot; hostId=&quot;114149731&quot; size=&quot;819&quot; leadHost=&quot;true&quot; account=&quot;&lt;account&gt;&quot; cacheHostName=&quot;AppFabricCachingService&quot; name=&quot;&lt;old_server&gt;&quot; cachePort=&quot;22233&quot; \/&gt;\r\n&lt;host replicationPort=&quot;22236&quot; arbitrationPort=&quot;22235&quot; clusterPort=&quot;22234&quot; hostId=&quot;1975933372&quot; size=&quot;8191&quot; leadHost=&quot;true&quot; account=&quot;&lt;account&gt;&quot; cacheHostName=&quot;AppFabricCachingService&quot; name=&quot;&lt;new_server&gt;&quot; cachePort=&quot;22233&quot; \/&gt;\r\n&lt;\/hosts&gt;\r\n<\/pre>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\r\n#import the modified cluster configuration\r\nImport-CacheClusterConfig -file D:\\CODE\\clusterconfigmodified.xml\r\n#Start the cluster\r\nStart-CacheCluster\r\n#and check if the service is UP\r\nGet-CacheHost\r\n<\/pre>\n<p>Check if the service status of the new server is UP and the old server isn&#8217;t listed as cache host anymore<\/p>\n<p>HostName : CachePort\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Service Name \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0Service Status<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#8212;&#8212;&#8212;&#8212;&#8211; \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>&lt;new_server&gt;:22233 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0AppFabricCachingService \u00a0 \u00a0 UP<\/p>\n<p>Check if AppFabric Cache service is started in Services and in Central Administration.<\/p>\n<p>In the ULS the following messages appeared:<\/p>\n<blockquote><p>Calling&#8230;      SPDistributedCacheClusterCustomProvider:: BeginTransaction<br \/>\nSuccessfully executed&#8230;      SPDistributedCacheClusterCustomProvider:: BeginTransaction<\/p><\/blockquote>\n<ul type=\"disc\"><\/ul>\n<p>And SharePoint is responding quite a lot faster than before!<\/p>\n<h3>Summary<\/h3>\n<p>This post described how to fix Distributed Cache service issues on a cloned SharePoint machine where the cache host pointed to the &#8216;old&#8217; server.<\/p>\n<p>There are different caches that depends on the Distibuted Cache service: Login Token Cache, Feed Cache, Last Modifed Cache, Search Cache, Security Trimming Cache, View State Cache, and more. Therefor it&#8217;s quite important and convenient when the Distributed Cache service works properly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently I worked on a SharePoint 2013 VM for development purposes. This cloned VM contained 16 GB of memory which isn&#8217;t a lot for a SP2013 environment. To be able to work with the VM at a certain speed the &#8230; <a class=\"more-link\" href=\"https:\/\/www.itidea.nl\/index.php\/cloned-vm-slow-due-to-distributed-cache-issues-in-sharepoint-2013\/\">Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[43,44],"class_list":["post-1715","post","type-post","status-publish","format-standard","hentry","category-sharepoint-2013","tag-powershell","tag-sharepoint-2013"],"_links":{"self":[{"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/posts\/1715","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/comments?post=1715"}],"version-history":[{"count":21,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/posts\/1715\/revisions"}],"predecessor-version":[{"id":1736,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/posts\/1715\/revisions\/1736"}],"wp:attachment":[{"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/media?parent=1715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/categories?post=1715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itidea.nl\/index.php\/wp-json\/wp\/v2\/tags?post=1715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}