Branchcache between 2 2012R2 servers

Hi,

I found the BranchCache documentation lacking as more and more usual with MS. There's a lot of info on what it does and a lot of marketing jabbajabba but not much technical info - at least not for troubleshooting. I am having a remote site which only has one 2012R2 server. No clients. That server holds a copy of some data in the main site. On several places there is some info on how 'well branchcache works with deduplication in 2012R2'.

My goal is to use branchcache to limit WAN bandwidth usage while syncing the data over SMB. What I have done now is enabled branchcache for network shares on the main sites share, configured it's GPO to 0ms latency, allowed hasing for all shares (just to be sure) but still enabled Branchcache on the specific share.

On the remote site, having just one server there I enabled Branchcache in distributed mode, as I see no use in hosted mode in this environment (but please prove me wrong if needed!). It's enabled through GPO and it is in fact enabled:

PS C:\Users\<me>> get-bcstatus

BranchCacheIsEnabled        : True
BranchCacheServiceStatus    : Running
BranchCacheServiceStartType : Automatic


ClientConfiguration:

    CurrentClientMode           : DistributedCache
    HostedCacheServerList       :
    HostedCacheDiscoveryEnabled : False


ContentServerConfiguration:

    ContentServerIsEnabled : True


HostedCacheServerConfiguration:

    HostedCacheServerIsEnabled        : False
    ClientAuthenticationMode          : Domain
    HostedCacheScpRegistrationEnabled : False


NetworkConfiguration:

    ContentRetrievalUrlReservationEnabled : True
    HostedCacheHttpUrlReservationEnabled  : True
    HostedCacheHttpsUrlReservationEnabled : True
    ContentRetrievalFirewallRulesEnabled  : True
    PeerDiscoveryFirewallRulesEnabled     : True
    HostedCacheServerFirewallRulesEnabled : True
    HostedCacheClientFirewallRulesEnabled : True


HashCache:

    CacheFileDirectoryPath               : C:\Windows\ServiceProfiles\NetworkService\AppData\Local\PeerDistPub
    MaxCacheSizeAsPercentageOfDiskVolume : 1
    MaxCacheSizeAsNumberOfBytes          : 533169397
    CurrentSizeOnDiskAsNumberOfBytes     : 29433856
    CurrentActiveCacheSize               : 0


DataCache:

    CacheFileDirectoryPath               : C:\Windows\ServiceProfiles\NetworkService\AppData\Local\PeerDistRepub
    MaxCacheSizeAsPercentageOfDiskVolume : 5
    MaxCacheSizeAsNumberOfBytes          : 2665846985
    CurrentSizeOnDiskAsNumberOfBytes     : 29433874
    CurrentActiveCacheSize               : 0

    DataCacheExtensions:

Both main-site as well as remote-site volumes are deduped by the way. As I understand from the sumire info available that should in fact help branchcache as the files are already hashed. No matter how often I copy a single file from the main site, I never get any results. I have perfmon opened with all branchcache counters, but they don't reflect a single action or byte at all. I have used https://mizitechinfo.wordpress.com/2014/12/30/step-by-step-deploy-configure-branchcache-in-windows-server-2012-r2/, https://gallery.technet.microsoft.com/Windows-Server-2012-R2-and-c18a6dd1 and https://technet.microsoft.com/library/jj572990 to no avail.

I am now installing Windows 8.1 Enterprise now as here and there I read you need enterprise to use this. However all client components seem to be available in 2012R2 as well.



My concrete questions:

- Is it at all possible to use 2012R2 as a client? About the same question here: https://social.technet.microsoft.com/Forums/windowsserver/en-US/551c55ab-7e49-4a18-8315-13fcf3cab522/branchcache-client-on-a-rd-host?forum=winserverfiles but no answer.

- What should I expect BranchCache to do together with dedupe?





January 28th, 2015 2:40pm

Hey,

Interesting concept, havent been thinking about this scenario. What SKU do you have on the server? Standard or Enterprise?

If you run a "netsh branchcache show status all" do you have any bytes in the cache on the distributed mode server?

I'll see if I can spin up a Server to test, will also email the product group to see if they have an answer.

best regards,

//Andreas
http://2pintsoftware.com

Free Windows Admin Tool Kit Click here and download it now
January 28th, 2015 6:15pm

Hi, 0 bytes:

C:\Users\<me>>netsh branchcache show status all


BranchCache Service Status:
-------------------------------------------------------------------------------
Service Mode                 = Distributed Caching (Set By Group Policy)
Serve peers on battery power = Disabled
Current Status               = Running
Service Start Type           = Automatic
This machine is not configured as a hosted cache client.

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     (Not Required)
Hosted Cache HTTP 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        (Required)
Hosted Cache Server Firewall Rules         = Enabled        (Not Required)
Hosted Cache Client Firewall Rules         = Enabled        (Not Required)

Warning: The Windows Firewall is Currently Disabled.



That's what I expected as get-bcstatus retrieves the same info. Both machines are 2012R2 Standard, I didn't try with Enterprise. However, all components are there and can be configured just as expected so it would be weird if it can't be used? In addition, it's very feasible for branch-offices to have one Remote Desktop server for which branchcache could be very good.

January 28th, 2015 6:31pm

Checked, its supposed to work. Still might be a standard/enterprise thingie. Have asked for clarification on that.

One thing though, that you need to be aware of:

1. BranchCache hashes will only be generated when files are being accessed
2. If the hash is not created at download time, then the copy will not use BranchCache (as there is no hash
3. A file update will delete the hash.
4. Since you only have one client, it will never get data from other peers, so you are left with de-dup (which is still great)

So, basically force the creation of hashes with hashgen.exe before trying anything out, then the bytes should be visible in the cache.

//Andreas

Free Windows Admin Tool Kit Click here and download it now
January 28th, 2015 6:34pm

I didn't try hashgen yet, nor am I familiar with it. I assume the source data (in the main site) needs to be hashed with this? I ran it:

C:\Users\<me>>hashgen "v:\New folder"
Processing directory v:\New folder

 File hpacuoffline-8.75-12.0.iso processed successfully for hash version 1.
 File hpacuoffline-8.75-12.0.iso processed successfully for hash version 2.
 File VSE880POC975906.zip processed successfully for hash version 1.
 File VSE880POC975906.zip processed successfully for hash version 2.

 Processing complete.
 4 Files processed successfully.
 0 Files processed unsuccessfully.

I know I only need V2 hashes with 2012R2 only, but just to be sure. I copied these files to the remote site, either push and pull, but it won't work. Still 0 bytes cached.

After that I also let the remote site hash but still 0 bytes in cache and doesn't copy any faster (the two testfiles were already in destination once while hashing).

I am at the moment not even sure anymore how the process is, I've read too much acbout it today I guess. When I have a Branchcache enabled share at site A, and a distributed (or even hosted for that matter) cache on site B, and I copy a file a few times (three I believe) the data should be in the distributed cache, correct? In addition I believe, but the information is very scarce on that, that when we have deduped volumes we copy from and to, branchcache can use the hashes from that as well and really only transfer changed blocks from site A to B opposed to the whole file if it isn't available. A bit like source-side deduplication more or less. That is what I need to achieve in fact. The files that need to be synced there are about 98% identical each day, but large in individual size. I don't want to transfer 100GB when only 1GB is actual new data. That's my goal.

 Thanks for your help so far, greatly appreciated!


January 28th, 2015 9:27pm

How a you doing the copy? Explorer?

//Andreas
http://2pintSoftware.com

Free Windows Admin Tool Kit Click here and download it now
January 28th, 2015 10:57pm

Yes, explorer. As far as I am concerned, as long as the application uses regular Windows apis to call the SMB copy it doesn't even matter, but for what it's worth I also copied from a command prompt.
January 29th, 2015 9:04am

I guess you could test the whole Enterprise vs Standard thing by using BITS to try the copy. Maybe 2012 Standard is behaving like Windows Pro in BranchCache terms?

 The 'by deault' SMB integration is not enabled in Pro, only Enterprise.  The BranchCache APIs still work in Pro, and BITS uses them directly, so BITS and custom applications will still be able to use BranchCache on Pro (and therefore maybe on server standard?)

Something like:

Start-BitsTransfer -Source C:\files\myBigISO.iso  -Destination\\Server\c$\files -Priority normal

cheers

//Phil

http://2pintSoftware.com

Free Windows Admin Tool Kit Click here and download it now
January 29th, 2015 10:28pm

Good idea to try with BITS, hadn't thought of that. However it's still not working. The transfer works fine but no hasing is used nor is anything cached.

About the standard / enterprise thing, I wonder about that as 2012R2 has no enterprise edition, those were merged to standard (ie. most features that needed enterprise before are available in 2012(R2) standard). The only 'higher' option is datacenter but I don't think that's feasible for Branchcache.


January 30th, 2015 7:49am

hi,

got a chance to quickly test this yesterday - doesn't look good!

Firstly, did you enable the 'Allow hash generation policy? without that hashes won't get generated - even if hashgen.exe runs ok.

Secondly, did you verify that BranchCache is working by tying to download from each server via a Win 8.x client?

I have 2 2012R2 servers, both setup for BranchCache for Network Files. Both work fine for Windows 8.1 clients.

When I try to BITS Transfer from one server to the other - as you have seen, it doesn't seem to work.

So far I haven't figured out why :-) but mu hunch is that SMB BranchCache is closely tied to Offline Files which isn't going to cut in on servers..

HTTP would be your other option?

cheers

Phil

http://2pintsoftware.com

Free Windows Admin Tool Kit Click here and download it now
January 31st, 2015 10:03am

On the main site I have branchcache for network enabled, and the hasing policies set to 'allow all shared to be hashed'. On the remote site I have branchcache for network as well as branchcache itself installed, if you don't do so you can't even enable a caching server. I can't get over the fact that you can install and configure it fine but can't use it? That's weird beyond believe.

I can try with Windows 8.1 but I am not sure if that's going to run on my remote HP server hardware. I could ofcourse always virtualize it but well, thats another bunch of overhead. In addition while I know they share about the same kernel, I don't think I want to use a desktop OS for a backup repository :)

I just don't get why it would not be possible between servers, and second why there is no serious documentation on this once again...

I'll try a test setup with Windows 8.1 though.
January 31st, 2015 11:23am

I deployed a Windows 8.1 enterprise machine. That one actually builds up the datacache:

HashCache:

    CacheFileDirectoryPath               : C:\Windows\ServiceProfiles\NetworkService\AppData\Local\PeerDistPub
    MaxCacheSizeAsPercentageOfDiskVolume : 1
    MaxCacheSizeAsNumberOfBytes          : 423949721
    CurrentSizeOnDiskAsNumberOfBytes     : 29433856
    CurrentActiveCacheSize               : 0


DataCache:

    CacheFileDirectoryPath               : C:\Windows\ServiceProfiles\NetworkService\AppData\Local\PeerDistRepub
    MaxCacheSizeAsPercentageOfDiskVolume : 5
    MaxCacheSizeAsNumberOfBytes          : 2119748605
    CurrentSizeOnDiskAsNumberOfBytes     : 55619602
    CurrentActiveCacheSize               : 37960751

however it still doesn't work how I want it to. When I copy the same file again from the source servers, it's transfered again completely. Most probably if I install another 8.1 client and copy that file again, it would come from the first 8.1 machine. But what I want is limit bandwidth between 2 machines, not a whole remote network of machines. Pulling my hair out on this :/

Free Windows Admin Tool Kit Click here and download it now
January 31st, 2015 4:44pm

You say source 'servers'?

If you have 2 servers, and copy a file from one of them, then copy the same file from another, it will always copy the file from the server each time , unless you set the same Server Secret for each server.

copying the files from 2 different servers - even if the file is identical - means that the hashes will be different..

I think that the problem might be server versions - will try to confirm with MS

Phil

January 31st, 2015 5:06pm

I said servers but I meant server. I am testing by copying a 100MB file from the very same share each time. What I expected is the second or maybe third copy to be consuming less bandwidth. Alas it's not working like that (yet..)

By the way what I've read and made out of the scarce documentation available is that when used together with dedup, any block that already exists in either file is not transfered again. That way it should in fact work if I copy the same file from two servers. I'm looking up the source of that info.

Free Windows Admin Tool Kit Click here and download it now
January 31st, 2015 5:12pm

FIXED IT (I think)

So, you need to install the Desktop Experience feature on your server. This is because BranchCache SMB is linked to offline files.

Install the feature under 'User Interfaces And Infrastructure' (it needs a reboot)

Go to sync center - enable offline files (another friggin reboot)

Then retry your tests - I just dragged a file from the other server share and it went straight into the BranchCache cache

Cheers

Phil

http://2pintsoftware.com



  • Proposed as answer by Phil Wilcock Saturday, January 31, 2015 6:46 PM
January 31st, 2015 6:46pm

and here's the quirks...

Once the above is all working:

Copy a file across

You will see the Cache bytes increase - look in Perfmon - SMB Bytes From Cache/Bytes from server

When you first copy the file - Bytes from Server will increase - and you will see stuff in the cache

BUT

Copy it again - and Bytes from Cache stays at Zero - huh?

This is because it's getting the files from your Offline Files location.

Delete your offline files and try again - you should see SMB Bytes from cache increase.

Might have to Blog this one :-)

Phil

Free Windows Admin Tool Kit Click here and download it now
January 31st, 2015 6:55pm

We should write a little powershell snippet to check all of these things to make it easier for people in the future.

ps. Also updated the original link.

//Andreas
http://2pintsoftware.com

January 31st, 2015 7:08pm

Great find, again I din't even think of installing desktop experience on a server.. There goes MS best-practice to install core servers wherever you can :) Anyway I will be experimenting with this tomorrow again. Thanks you so much for thinking with me in this. I tell you this is better than MS Pro support of the last few years, my god have they drifted of. Thanks and I'll keep you posted as well!
Free Windows Admin Tool Kit Click here and download it now
February 1st, 2015 10:44am

no problem Robert - hope you got it working?

Seems fine here in our lab, even got it going on Windows Server 10!

cheers

Phil

February 5th, 2015 3:49pm

Hi,

well as a matter of fact I didn't got it working - or at least I think it's not ok. After installing desktop experience and enable offline files, I got it to fill Local Cache: Cache complete file segments, Retrieval: Bytes from server and SMB: Bytes from server. However, if I copy the same file again it travels through WAN completely again. I've also setup a Windows 8.1 Enterprise machine, which behaves the same. It builds up the cache in its ditributed caching mehanism, but effectively it doesn't save me a single byte of traffic.

Free Windows Admin Tool Kit Click here and download it now
February 5th, 2015 4:13pm

OK,

Well we know it works just fine :-)

Here I have 2 servers connecting over a connection that is throttled down to 500kbs - so I copy the file (using robocopy OR drag n drop in explorer) - Takes a good few seconds.

Check the cache - bytes in cache matches the file size.

Retry the copy - quick as a flash. Also logged it via Message Analyser and the network traffic for the second attempt was tiny.

So, not sure what is wrong with your config.

How are you copying the file? How are you measuring the WAN traffic?

cheers

Phil

February 5th, 2015 4:49pm

Hi Robert -

From the BranchCache overview topic at https://technet.microsoft.com/en-us/library/hh831696.aspx :

Following is a list of operating systems that support different types of BranchCache functionality.

Operating systems for BranchCache client computer functionality

Windows 8 Enterprise
Windows 7 Enterprise
Windows 7 Ultimate

*****

The Data Deduplication topic will provide details on that File Services technology. It's at https://technet.microsoft.com/en-us/library/hh831602.aspx. Basically dedupe removes duplicate content from files. If the files have duplicate content, this makes the file footprint smaller on disk and quicker to send to clients in branch offices across the WAN. In your branch offices, BranchCache has the capability to restore the file to the source content (in other words remove the effect of deduplication).

Thanks -

Free Windows Admin Tool Kit Click here and download it now
February 6th, 2015 5:48pm

Just a footnote to the OS version question.

This causes a lot of confusion, because it's made to look like any version of Windows 7/8/8.1 Professional will not work with BranchCache at all.

In fact all Windows Professional versions support BranchCache via BITS - just not 'natively' i.e using IE/Explorer, Robocopy etc.

So for instance, if you use SCCM 2012 to distribute software, BITS/BranchCache work just fine..

thanks

Phil
February 8th, 2015 12:54pm

Well, we can add the server flavours to the list of working OS list as well.

//Andreas
http://2pintsoftware.com

Free Windows Admin Tool Kit Click here and download it now
February 9th, 2015 6:40pm

For some reason I still haven't got it working. The cache builds up but isn't used. Every time I copy the very same file over, it's transfered completely through the WAN. I'll investigate and report but that's gonna be next week. As I think this is interesting for other people as well though I will deffinetely get back at this.
February 12th, 2015 9:49am

Finally had time to spend on this, and glad to report I finally got it working. The issue was I was probably stared blind at it, as I forgot to install the desktopfeatures on the source-server in the datacenter, which made branchcache-SMB not work. It now works, altough it has some quirks - in only works when the remote server pulls data from the source, when source copies data to remote it doesn't. It works together with Dedupe rather well - as soon as dedup ran these hashes are used.

So some quirks I have to work out but for now I'm good :) Thanks for your help!


Free Windows Admin Tool Kit Click here and download it now
March 17th, 2015 10:26am

Better late than never :-) Glad you got it all working..

Phil

March 17th, 2015 11:43am

It still doesn't work the way I thought it would. I have two testfiles, 1.iso and 2.iso. Each about 150MB in size. When I copy them, it uses regular bandwidth as expected. Then I reboot the branchserver to be sure filesystem cache is flushed and stuff like that. Copy them over again, done in a second. However, when I combine the two files in one larger file, I would expect it to be fast again, as the content of that new file is exactly the same as of the two seperate files. That file travels the line completely again though.

Even if I copy one of the testfiles on the source server to another file, creating 2 identical files with only a different name, the whole file travels the line again.

So I feel Branchcache does use dedupe hashes to prevent generating CPU to create new hashes, but that it does not use the 'global' store of hashes, but on a per file level. As far as my test go I cannot get it to do source-side-dedupe. That's what I want to achieve, to copy only unique data across but on a volume-wide base. We make one full backup every week, whicih differs only a few percent opposed to last weeks backup. I'd like to transfer only the unique blocks as the rest is already at the destination side.


Free Windows Admin Tool Kit Click here and download it now
March 18th, 2015 2:49pm

De-Dup is only Server 2012 and Win8 clients! But should in theory work as you say, I have seen it with WIM files.

//Andreas
Co-Founder http://2pintsoftware.com

April 3rd, 2015 8:50pm

Wanted to update you. I've bene working on this again but I found Branchcache to be rather worthless with regards to dedup, at least for what I am trying to achieve here. As stated before it only works on file-level, not globally. So if I have identical files A and B, move A across, B will tranfer across completely as well, despite it's content should already be there and hashed. In addition the hashes / dedupstore on the remote site is not used at all. Imagine I have an ISO file at the remote site, which has hashes, either from hashgen or dedupe. The same file is on the main site as well. When I copy that to the remote site again in a different folder, the file is copied across completely, while in fact it could have used the dedupe store or blocks that where already present.

Even when used for what its actually created I think branchcache is lacking quite a bit. Bummer :/

Thanks for your help all, greatly appreciated.

Free Windows Admin Tool Kit Click here and download it now
May 28th, 2015 11:22am

Hmm, this is not what we see. If I redeploy a new .Wim image (updated or new) BC only downloads a few MBs. So Think your env is acting up, what kind of latency do you have? The SMB integration is fairly mind-blowing complicated.

//A

May 29th, 2015 9:29pm

In my testsetup I deliberately used a rather slow ADSL link, which has about 25-30ms latency to the datacenter. Branchcache treshold is set to 0ms. The remote server is setup as distributed AND it is in fact a 2012R2 server. Maybe in your environment you have actual client OSes? Although I tested with Windows 8.1 as well and it didn't work well there either.

So what's your setup and can you confirm that when you copy an ISO across for example, then on the source side copy that iso to a new file, copy that across as well it's fast? And are you using dedupe or regular hashing?

Free Windows Admin Tool Kit Click here and download it now
May 30th, 2015 10:36am

Never got it to do BC initiated by the source side, and if I recall the design from memory (not always the best) it will never be initiated that way.

So you would have to pull from the destination side, otherwise it will never work. :( But maybe by using remote Powershell you can get around that limitation?

Our tests have been with Enterprise client OS's but should be the same. Might be Worth a revisit to sanitize and document the results a bit more.

//A

May 31st, 2015 8:39am

Thank you for your reply. I know BC is working only when pulling, which is ok by me for this setup. I can't get it to work globally though, but as said only per file. How large is your cache? And do you use dedupe? I am actually not sure by now if it really uses the dedupe store (granted the blocks are in fact in the dedupstore).

So maybe you can answer a few questions; how large is your BC cache? Are you using dedupe on the source side?

Free Windows Admin Tool Kit Click here and download it now
May 31st, 2015 8:46am

I was pulling 4GB wims over the wire using Explorer. Cache was set to 25% of HD space (of 127GB virtual mahine) using a 10Mb/s link witht the BC latency setting set to 0 I belive.

Dedupe on both client side and server side, i.e. Windows 8 from Server 2012 R2.

A note on the dedupe store, the new file will be put together from the BC cache, which is de-dup aware, but its not actually put together from dedupe per say I believe.

//Andreas

http://2PintSoftware.com

May 31st, 2015 8:58am

That makes sense. As your WIM files fit complely in BC's cache, it's not sure here whether or not it uses the dedup-chunks. My issue is that I am trying to sync 1TB+ files over. Way too big for BC cache. about 95% of the data is deduped though, hence it's chunks and hashes are in the dedupe store. I'd love to see BC actually use that (preferably on both sides) in order to minimize network traffic.

Still even with smaller testfiles it doesn't work like it should. I completely rebuilt my test setup and still the same. Same files copies across fast after it's cached, but same file with another name doesn't. Seems like it doesn't realy work hash-bashed in my setup.

Free Windows Admin Tool Kit Click here and download it now
June 8th, 2015 1:19pm

Hmmm, this must be why it doesnt work. You are simply running out of BC cache space, causing full download to happen. Simple fix, double the storage space and increase the BC cache size! ;-)

Your suggestion makes sense, but would have to be a Another Components I Think. One guy on the forum here did a tool what you are asking for, not free of charge though.

//Andreas

June 9th, 2015 10:37am

But why would I need a large BC cache if BC can use the dedup-store (which it claims it does) where 95% of my data is in?

Are you able to find the name or thread of the tool you mentioned? I've been working with Replacador, but that isn't really what I want, as that syncs a whole disk, rather than files. To little flexibility there.


Thanks for your reply!
Free Windows Admin Tool Kit Click here and download it now
June 9th, 2015 10:41am

Ah, it was replicador that I was thinking of, I thought it did files as well, thats why we didnt write one. Interesting... might have a look for that.

When BC does de-dup in has its own de-dup storage on the "client" side, which is managed by the cache. So basically the entire data set (de-duped) needs to fit inside the cache.

//Andreas

June 23rd, 2015 3:27am

Hi Andreas,

yes that's what I found. And with that I can almost state that Microsofts statement BC works together with dedupe is hardly true. Yes it works, as practically any other program works with it as dedupe is on such low level its driver dedupes any requests a regular program does to the OS anyway. Working together in this regards from my perspective is that it actually integrates and uses each other chunks in order to benefit from each other. Now they just work 'next to each other. I can now safely state that all tools, scripts and utilities I wrote myself are dedupe compatible ;)

Free Windows Admin Tool Kit Click here and download it now
June 23rd, 2015 3:36am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics