locked
Branchcache, cache is not used by clients RRS feed

  • Question

  • Hello.

    I'm currently testing out Branchcache as a customer wants it implemented soon. I've followed http://www.microsoft.com/en-us/download/details.aspx?id=19558 and a couple of other guides on technet.

    The Lab enviroment has 3 sites, 1 main site, 1 branchoffice and 1 homeoffice. Branch office will use hosted cache mode and the homeoffice site will use distributed mode. All servers are 2008R2 Enterprise and all clients are Win7 Enterprise.

    Using the branchcache counters in perfmon on both clients and servers, I copy approx 10MB from a branchcache-enabled share on the central server to a client and wait a few secs. Then I check using netsh branchcache show localcache that I have data in the local cache and I do. Also the size is correct.

    On the "branchoffice" site, which has a local DC and a server to act as a BC hosted cache mode, I see in perfmon that data is pulled over the network and not cache by the first copy operation, and netsh says both the client and the hosted cache server has a correct size in the cache (approx 10MB). When another client, in the same site, accesses the same share and copies the same folder then the 10MB are all retrieved over the network, according to the BC-counters in perfmon.

    I also perform the same test on the "homeoffice" site which contains 2 Win7 Enterprise clients configured with branchcache distributed mode with GPO. And there I also see all the data transferred over SMB, stored in the cache, I'm waiting a minute or so and then repeat the same process on the other client, and everything is pulled over SMB from the server in the main office.

    So I've checked again and again: deleted temp files and flushed the cache between each try.

    * Certificate on hosted cache server ok, and trusted by the Clients. Self-signed cert from IIS, deployed into the clients "Trusted root CA" with public key only.

    * Firewall: both in and out, using pre-defined in Windows, applied with GPO

    * Branchcache services running

    * The share is branchcache-enabled

    * Client and server OS versions

    * Clients in "BranchOffice" are using the FQDN to the hosted cache server and central fileserver. Both is reachable by FQDN.

    Can anyone suggest what I'm missing cause I'm lost at the moment.

    Thank you very much :)


    Regards Per-Torben Sørensen

    Tuesday, August 14, 2012 1:01 PM

Answers

  • Well for HTTP(S) traffic you need 3 clients to demonstrate it but using SMB you only needs 2. Set the group policy “Hash Publication for BranchCache” on the file server(s) found in Administrative templates > Policies > Network > Lanman Server and the hashes will be generated and you can do the demo/proof of concept with only 2 clients.

    Blogging about Windows for IT pros at www.theexperienceblog.com

    Wednesday, August 15, 2012 8:16 PM
  • Hi there -

    Here's some additional feedback from the BranchCache team:

    From the details:

    -          it’s an SMB file copy

    -          the local cache on both Hosted Cache Client and Distributed Client are filled to correct size of 10MB so content is published on the BranchCache enabled share at the central server and latency settings are appropriately matchec

    -          additionally, in the Hosted Cache “branchoffice site” both Hosted Cache Client and Hosted Cache Server shows 10MB in their cache, so Hosted Cache Server retrieving from Hosted Cache Client works

    -          further, he’s retried and retried after deleting files and flushing BranchCache cache

    So in both scenarios, the data is available in the caches - the problems sound like:

    -          in Hosted Cache scenario, the 2<sup>nd</sup> Hosted Cache Client does not retrieve data from the Hosted Cache Server, instead it gets all from the central server

    -          in Distributed Cache scenario, same thing, the 2<sup>nd</sup> Distributed Client does not retrieve from a peer, instead it gets all from central server

    Things to consider and check:

    -          blocked ports?  He mentions predefined applied thru GPO – out of the box, these are not necessary for Hosted Cache or Distributed modes so maybe there’s a mix up there??

    -          ask to look thru the BranchCache event logs on:

    • Hosted Cache Clients
    • Hosted Cache Server
    • Distributed Clients

    -          (Distributed) clients are running under battery power???  unlikely but possible

    ThaThanks -


    James McIllece

    Thursday, August 16, 2012 5:15 PM
  • Hi Per-Torben -

    I received a response from the product team, and basically you need to user one more client in your download tests. From the product team:

    "Unless hashes are generated in advance on the content server, only the third client asking for the same content will actually be able to retrieve it from a peer or from the HC (hosted cache) server.

    1. First client gets only the content (and no hashes), as the content server generates the hashes and stores them locally
    2. Second client gets the hashes – but no one else has them in the branch, so ends up getting the content from the content server
    3. Only the third client gets the hashes and is able to retrieve the content inside the branch, because now another client (for distributed mode) or the HC server (for HC mode) have the hashes as well

    Hope that helps -


    James McIllece

    Wednesday, August 15, 2012 8:13 PM

All replies

  • Hi Per-Torben -

    This sounds like it is probably a latency issue - specifically that you don't have any latency because all of the BranchCache components are in a test lab rather than deployed over a WAN.

    The default BranchCache latency is 80 milliseconds (ms). For your test lab, you can set latency to 0 ms.

    To set the latency allowed between the client and the server, run the following command on client computers: netsh branchcache smb set latency 0.

    Hope that helps -


    James McIllece

    Tuesday, August 14, 2012 5:06 PM
  • I agree that it sounds like a latency issue and I might add that you do not have to wait for things to be cached before you can retrieve them from another client, that will work just right after it was cached on either the client or on the hosted cache server.

    Blogging about Windows for IT pros at www.theexperienceblog.com

    Tuesday, August 14, 2012 7:36 PM
  • I set the latency to 0ms initially in my lab, sorry I forgot to mention it.

    Regards Per-Torben Sørensen

    Wednesday, August 15, 2012 6:23 PM
  • No problem. I've forwarded your question to the BranchCache team, and if I hear back from them I will let you know.

    Thanks -


    James McIllece

    Wednesday, August 15, 2012 6:34 PM
  • Thank you very much, and please let me knoe if there is any information you want me to provide

    Regards Per-Torben Sørensen

    Wednesday, August 15, 2012 6:40 PM
  • Hi Per-Torben -

    I received a response from the product team, and basically you need to user one more client in your download tests. From the product team:

    "Unless hashes are generated in advance on the content server, only the third client asking for the same content will actually be able to retrieve it from a peer or from the HC (hosted cache) server.

    1. First client gets only the content (and no hashes), as the content server generates the hashes and stores them locally
    2. Second client gets the hashes – but no one else has them in the branch, so ends up getting the content from the content server
    3. Only the third client gets the hashes and is able to retrieve the content inside the branch, because now another client (for distributed mode) or the HC server (for HC mode) have the hashes as well

    Hope that helps -


    James McIllece

    Wednesday, August 15, 2012 8:13 PM
  • Well for HTTP(S) traffic you need 3 clients to demonstrate it but using SMB you only needs 2. Set the group policy “Hash Publication for BranchCache” on the file server(s) found in Administrative templates > Policies > Network > Lanman Server and the hashes will be generated and you can do the demo/proof of concept with only 2 clients.

    Blogging about Windows for IT pros at www.theexperienceblog.com

    Wednesday, August 15, 2012 8:16 PM
  • Apparently I still have much to learn about Branchcache. ;)

    Well, I thought I'd set the GPO mentioned and I'm focusing on SMB in this test because that's what we need it for. I will re-check my settings regarding the hash publication tomorrow and post back. How much time does the hash generation and publication takes? Is it on a set schedule or continously?


    Regards Per-Torben Sørensen

    Wednesday, August 15, 2012 8:20 PM
  • It is rather quick but to make certain before testing you can run "hashgen -f C:\PathToBranchCacheEnabledSharedFolder" to force a hash generation.

    Blogging about Windows for IT pros at www.theexperienceblog.com

    Wednesday, August 15, 2012 8:41 PM
  • The Hash publication is set to Allow hash publication only for shared folders on which BranchCache is enabled which should suffice in my mind.

    But this boggles my mind a bit: My Branch office site in my lab has 1 Dc, 1 Fileserver (Hosted cache) and 2 clients, I've run netsh branchcache show status all on the fileserver and the 2 clients and this is the output:

    Fileserver

    C:\>netsh branchcache show status all
    
    
    BranchCache Service Status:
    -------------------------------------------------------------------------------
    Service Mode          = Hosted Cache Server
    Client Authentication = No Authentication
    Current Status        = Running
    Service Start Type    = Automatic
    This machine is currently configured as a hosted cache server.
    
    Local Cache Status:
    -------------------------------------------------------------------------------
    Maximum Cache Size        = 5% of hard disk
    Active Current Cache Size = 0 Bytes
    Local Cache Location      = C:\Windows\ServiceProfiles\NetworkService\AppData\Lo
    cal\PeerDistRepub (Default)
    
    
    Publication Cache Status:
    -------------------------------------------------------------------------------
    Maximum Cache Size         = 1% of hard disk
    Active Current Cache Size  = 0 Bytes
    Publication Cache Location = C:\Windows\ServiceProfiles\NetworkService\AppData\L
    ocal\PeerDistPub (Default)
    
    
    Networking Status:
    -------------------------------------------------------------------------------
    Content Retrieval URL Reservation          = Configured (Required)
    Hosted Cache URL Reservation               = Configured (Required)
    SSL Certificate Bound To Hosted Cache Port = Configured (Required)
    Content Retrieval Firewall Rules           = Enabled    (Required)
    Peer Discovery Firewall Rules              = Enabled    (Not Required)
    Hosted Cache Server Firewall Rules         = Enabled    (Required)
    Hosted Cache Client Firewall Rules         = Enabled    (Not Required)
    

    First client:

    BranchCache Service Status:
    -------------------------------------------------------------------------------
    Service Mode          = Hosted Cache Client (Set By Group Policy)
    Current Status        = Running
    Service Start Type    = Manual
    Hosted Cache Location = pts-fil3.pt.lab (Set By Group Policy)
    
    
    Local Cache Status:
    -------------------------------------------------------------------------------
    Maximum Cache Size        = 15% of hard disk (Set By Group Policy)
    Active Current Cache Size = 276275 Bytes
    Local Cache Location      = Default
    
    
    Publication Cache Status:
    -------------------------------------------------------------------------------
    Maximum Cache Size         = 1% of hard disk
    Active Current Cache Size  = 0 Bytes
    Publication Cache Location = Default
    
    
    Networking Status:
    -------------------------------------------------------------------------------
    Content Retrieval URL Reservation          = Configured     (Required)
    Hosted Cache URL Reservation               = Configured     (Not Required)
    SSL Certificate Bound To Hosted Cache Port = Not Configured (Not Required)
    Content Retrieval Firewall Rules           = Enabled        (Required)
    Peer Discovery Firewall Rules              = Enabled        (Not Required)
    Hosted Cache Server Firewall Rules         = Enabled        (Not Required)
    Hosted Cache Client Firewall Rules         = Enabled        (Required)

    Second Client: 

    BranchCache Service Status:
    -------------------------------------------------------------------------------
    Service Mode          = Hosted Cache Client (Set By Group Policy)
    Current Status        = Running
    Service Start Type    = Manual
    Hosted Cache Location = pts-fil3.pt.lab (Set By Group Policy)
    
    
    Local Cache Status:
    -------------------------------------------------------------------------------
    Maximum Cache Size        = 15% of hard disk (Set By Group Policy)
    Active Current Cache Size = 0 Bytes
    Local Cache Location      = Default
    
    
    Publication Cache Status:
    -------------------------------------------------------------------------------
    Maximum Cache Size         = 1% of hard disk
    Active Current Cache Size  = 0 Bytes
    Publication Cache Location = Default
    
    
    Networking Status:
    -------------------------------------------------------------------------------
    Content Retrieval URL Reservation          = Configured     (Required)
    Hosted Cache URL Reservation               = Configured     (Not Required)
    SSL Certificate Bound To Hosted Cache Port = Not Configured (Not Required)
    Content Retrieval Firewall Rules           = Enabled        (Required)
    Peer Discovery Firewall Rules              = Enabled        (Not Required)
    Hosted Cache Server Firewall Rules         = Enabled        (Not Required)
    Hosted Cache Client Firewall Rules         = Enabled        (Required)

    The first client has 276275 Bytes in its local cache, shouldn't I find the same 276275 Bytes in the cache of the hosted cache server? I copied the same folder from the server down to the other client and all SMB traffic came from the server and nothing from cache according to the perfmon counters.


    Regards Per-Torben Sørensen

    Thursday, August 16, 2012 7:09 AM
  • Hi there -

    Here's some additional feedback from the BranchCache team:

    From the details:

    -          it’s an SMB file copy

    -          the local cache on both Hosted Cache Client and Distributed Client are filled to correct size of 10MB so content is published on the BranchCache enabled share at the central server and latency settings are appropriately matchec

    -          additionally, in the Hosted Cache “branchoffice site” both Hosted Cache Client and Hosted Cache Server shows 10MB in their cache, so Hosted Cache Server retrieving from Hosted Cache Client works

    -          further, he’s retried and retried after deleting files and flushing BranchCache cache

    So in both scenarios, the data is available in the caches - the problems sound like:

    -          in Hosted Cache scenario, the 2<sup>nd</sup> Hosted Cache Client does not retrieve data from the Hosted Cache Server, instead it gets all from the central server

    -          in Distributed Cache scenario, same thing, the 2<sup>nd</sup> Distributed Client does not retrieve from a peer, instead it gets all from central server

    Things to consider and check:

    -          blocked ports?  He mentions predefined applied thru GPO – out of the box, these are not necessary for Hosted Cache or Distributed modes so maybe there’s a mix up there??

    -          ask to look thru the BranchCache event logs on:

    • Hosted Cache Clients
    • Hosted Cache Server
    • Distributed Clients

    -          (Distributed) clients are running under battery power???  unlikely but possible

    ThaThanks -


    James McIllece

    Thursday, August 16, 2012 5:15 PM
  • Thanks for the input.

    The branchcache works now as expected, but I don't know why it works now and not earlier as I haven't changed any settings. To be honest that's the most frustrating scenario when I can't tell why something suddenly works. I'll set up a new testlab as it doesn't take long and see how things work on my second try. I'll post here when I've tried it out on the new lab.

    Thank you all for the assistance so far.


    Regards Per-Torben Sørensen

    Thursday, August 16, 2012 6:01 PM
  • Hi Per-Torben, I am very interested in this as I have just set up a lab with Win2012 and Win8 Enterprise to test branchcache and am seeing similar results.  I have a win2012 DC and 2012 file server in my main site, and across the wan (roughly 30ms of latency) I have another 2012 DC and 2012 file server, together with two win8 enterprise clients.  I have followed the BC deployment guide and get-BCStatus is showing pretty much what I'm expecting - however my hosted cache server doesn't really seem to be doing what it should.

    I am going to try the command to force the hash generation, but this really shouldn't be necessary right?

    -Wes

    Sunday, September 9, 2012 8:05 PM
  • After HOURS of troubleshooting, we found the issue:

    On the Branch Cache server, not only the "BranchCache" Feature has to be installed. The "BranchCache for Network Files" (Sub Role of "File Services") hast to be installed as well.

    After that, the hosted Branch Cache server starts to work immediately. The incredibly low level of the Server 2012 / R2 Microsoft  documentation and Technet Content is catastrophic. And every blog writer probably takes the information from Microsoft or other blogs and  and miss that point as well.

    The only source with this information is an official MCT LAB Guide from Microsoft and classified as "MCT use only".

    Franz

    Thursday, February 26, 2015 10:30 AM
  • Hi Franz -

    Your statement that instructions to install the BranchCache for network files role service does not exist in the Microsoft BranchCache documentation is incorrect.

    This information is included in both BranchCache Deployment Guides (WS12 at https://technet.microsoft.com/en-us/library/jj572990.aspx & WS08R2 at https://technet.microsoft.com/en-us/library/ee649232(v=ws.10).aspx), in a Core Network Companion Guide on installing BranchCache in hosted cache mode (at https://technet.microsoft.com/en-us/library/jj862369.aspx), and even in a blog post I wrote two or three weeks ago (at http://blogs.technet.com/b/wsnetdoc/archive/2015/02/05/deploy-branchcache-content-and-hosted-cache-servers-using-windows-powershell.aspx).

    In most cases you will achieve a higher rate of success when using official Microsoft documentation in the Windows Server Technical Library than if you use third party content.

    Thanks -


    James McIllece

    Thursday, February 26, 2015 7:31 PM
  • James,

    sorry but I have to agree to some extent with Franz. The docs do exist, but are badly organized, don't go into enough detail, and in some cases are misleading. You only have to do a search of these forums to confirm that view from others.

    For example - I've lost count of the number of times that I've heard people claim that 'BranchCache does not work on Pro versions of Windows' - and there is no clear guidance as to what does and doesn't work in the different SKUs.

    It wouldn't take much work to at least update the main page at www.Branchcache.com to provide a better starting point for people to get to the correct docs depending on their OS version for example.

    BranchCache is a tricky technology to get to grips with, and I think that MS needs to at least recognize that there is still work to be done in educating the world as to how to get started with this great tech.

    We started a page on our website to try to give people a clearer idea of where to go for the right MS docs, but we'd much rather you guys did it TBH!

    http://2pintsoftware.com/microsoftbranchcache

    regards

    Phil


    Phil Wilcock http://2pintsoftware.com @2pintsoftware

    Thursday, February 26, 2015 8:43 PM
  • Hi James and Phil

    Thank you for your feedback! You obviously care about the Microsoft documentation, which is good news.

    @Phil: Thanks for your work, http://2pintsoftware.com/microsoftbranchcache is a very good starting page.

    @James: The first link you mentioned is the only one that works, the others just display "content not found". But you are right about the first link: The requirement of "BranchCache for network files" is mentioned there. But when digging from this overview to the chapter "Deploying hosted Cache Servers", "BranchCache for network files" is missing from the "step by step guide".

    We used the following official Microsoft documents for our Branch Cache deployment:

    Deployment Guide BranchCache 2012: http://www.microsoft.com/en-us/download/confirmation.aspx?id=30418

     Portal Technet: https://technet.microsoft.com/en-us/library/dd425028.aspx

    - BranchCache Deployment Guide: https://technet.microsoft.com/en-us/library/ee731914(v=ws.10).aspx

    In all these three sources, the requirement for "BranchCache for network files" is not mentioned with one word. 

    I'm sorry if I was too harsh with my comment about "catastophic MS documentation". The reason was also because we are working on a 2012 R2 RDS project, and the only 2012 and 2012 R2 RDS documentation that is available is a Wiki and Blog pages. The Technet 2008 R2 RDS content was never updated to 2012 / 2012 R2 RDS.

    Kind regards,

    Franz


    • Edited by FranzSchenk Friday, February 27, 2015 8:24 AM
    Friday, February 27, 2015 8:19 AM
  • Hi Franz -

    Again, you are incorrect. I just downloaded the first guide you mention, the BranchCache Deployment Guide for Windows Server 2012. On page 12 is the following section: "To install File Services and the BranchCache for network files role service" - which is followed by instructions on how to do so. In addition, the PowerShell command is provided for installing by that method.

    The second link you provide leads to a web guide - which also contains the same instructions:

    "In Select Role Services, in Role services, ensure that File Server is selected. Also select the BranchCache for network files check box, and then click Next." ( https://technet.microsoft.com/en-us/library/ee649251(v=ws.10).aspx )

    Before you throw such severe criticism about documentation, it might be a good idea to read it, and follow it, first.


    James McIllece


    Friday, February 27, 2015 3:35 PM
  • Hi James

    I do not agree.

    We installed this role on the content server as described on page 12 on this guide.

    The problem that cost us hours of troubleshooting was that this role has to be installed on the Hosted BranchCache Server as well. And this fact is not in the Guide, see Page 19, chapter "Deploy Hosted Cache Servers (Optional)"

    Franz

    Friday, February 27, 2015 3:42 PM
  • Actually that's not correct - the BranchCache feature is required on hosted cache servers.

    Thanks -


    James McIllece

    Friday, February 27, 2015 3:55 PM
  • I just logged onto a non-domain joined machine running Windows Server 2012 and successfully configured a hosted cache server with the following commands, which are provided in all of the documentation:

    Install-WindowsFeature BranchCache -IncludeManagementTools

    Enable-BCHostedServer

    Get-BCStatus

    The Get-BCStatus command displays BranchCache configuration information. Under HostedCacheServerConfiguration, the value for HostedCacheServerIsEnabled is True, as is expected.

    I understand that the use of the BranchCache Feature vs. the BranchCache for network files role service can be confusing. This is why I created the BranchCache Installation Guide section of the BranchCache topic at https://technet.microsoft.com/en-us/library/hh831696.aspx?f=255&MSPPError=-2147217396#BKMK_4

    Thanks -


    James McIllece


    Friday, February 27, 2015 4:08 PM
  • You can write as much as you want that the official MS documentation is sufficient. IT IS NOT for us as customers.

    My colleague an MCT trainer has spent half a day to build the LAB installation for BrancheCache, and it works immediately. We then searched for the difference from the LAB installation and the customer installation that doesn't work:

    I think it's useless to argue more about the MS documentation. I just hope that the Information that the "BranchCache for Network files" Server role has to be installed on the Hosted BranchCache Server as well saves other useres These hours of Troubleshooting that we had to spend.

    Franz

    Friday, February 27, 2015 4:09 PM
  • I just logged onto a non-domain joined machine running Windows Server 2012 and successfully configured a hosted cache server with the following commands, which are provided in all of the documentation:

    Install-WindowsFeature BranchCache -IncludeManagementTools

    Enable-BCHostedServer

    Get-BCStatus

    The Get-BCStatus command displays BranchCache configuration information. Under HostedCacheServerConfiguration, the value for HostedCacheServerIsEnabled is True, as is expected.

    I understand that the use of the BranchCache Feature vs. the BranchCache for network files role service can be confusing. This is why I created the BranchCache Installation Guide section of the BranchCache topic at https://technet.microsoft.com/en-us/library/hh831696.aspx?f=255&MSPPError=-2147217396#BKMK_4

    Thanks -


    James McIllece



    You are absolutely right, we have been at the same point. But the Server doesn't cache one byte of fileserver data when the branchcache for Network file server roles is not installed.
    Friday, February 27, 2015 4:13 PM
  • The document you're providing is technically incorrect. The BranchCache feature is installed on hosted cache servers and non-file server content servers, while the File Services server role with the BranchCache for Network Files role service is intended for use solely on BranchCache-enabled file servers.

    That said, I'm glad it's working for you and that your issue is resolved; however all other BranchCache customers have been following the existing BranchCache deployment guides with successful results.

    Thanks -


    James McIllece

    Friday, February 27, 2015 4:18 PM
  • Just FYI, I've sent your information to the product team for further investigation.

    Thanks -


    James McIllece

    Friday, February 27, 2015 4:31 PM
  • Hi Franz -

    As I mentioned in my last post, I queried the product team about this issue, and here is their response:

    "No, installing that role service [BranchCache for Network Files] is only needed on the content server.  The hosted cache server only needs the BranchCache feature. We’ll need more information on the customer’s environment and testing steps to understand what’s happening."

    So if you can provide more information about the environment, server, and any other relevant information, we can troubleshoot the issue so that you can correct your installation and make sure it's configured and running correctly.

    Thanks -


    James McIllece

    Friday, February 27, 2015 8:58 PM
  • I'm not convinced.

    When installing the BranchCache Feature with Server Manager, the following is displayed on 2012 R2:

    But when followng the instructions in BC_Deploy.doc and all other Microsoft BC Deployment Infomation, the BC Feature is installed with PowerShell and this Information is never displayed.

    Regards,

    Franz



    • Edited by FranzSchenk Saturday, February 28, 2015 5:35 PM
    Saturday, February 28, 2015 5:30 PM
  • Yes, confusing isn't it?

    But if you read it carefully (several times) It is correct.

    Fact is, you DO NOT need to install the BranchCache for Network Files role on a Hosted Cache server, just the Content server. I even tested this on Windows 10 Server in my lab yesterday, and the same still applies..

    I think that there might be a case for creating some checklists for each scenario here..

    There is a great guide for Step-by-Step configuration of a test lab - but only for WS2008R2 - I guess the 2012 edition didn't get written..

    Phil


    Phil Wilcock http://2pintsoftware.com @2pintsoftware

    Saturday, February 28, 2015 8:02 PM