BranchCache – Course 109: Where files are stored?!

We will be talking about some parameters to consider when deploying BranchCache. Mainly where the cache content files are stored.

Clients will always store cache files + the hashes of those files that describe the data in the following location : C:\Windows\ServiceProfiles\NetworkService\AppData\Local\PeerDistRepub.

To change this location on your Windows 7 BranchCache clients, use this command :

netsh branchcache set localcache directory=D:\MyCacheFiles

Now The size of that cache is by default 5% of the whole hard disk, to change the max size of cache content, use on of those commands:

Netsh branchcache set cachesize 20971520 ( this number is in bytes)

Netsh branchcache set cachesize size=20 percent=TRUE ( this will set the percentage to 20%)

Now, let us move to the content servers (Your WSUS and File Shares). Those content servers will generate hashes for their content so that BranchCache clients can download them instead of the whole content. The location of those hashes is called (Publication Cache). By default it is under %WINDIR%\ServiceProfiles\NetworkService\AppData\Local\PeerDistPub.

To change the location of the Publication Cache, use this command :

netsh branchcache set publicationcache directory=D:\BranchCache\

By default, Publication Cache will consume 1% from the hard disk. To change this number, use one of the following commands :

Netsh branchcache set publicationcachesize 20971520 (In Bytes)

Netsh branchcache set publicationcachesize size=20 percent=TRUE

 Another important notes :

If a BranchCache client wants to access a remote file share, the BranchCache will sense the latency to the remote file share server. If the latency is below 80 ms (default value), then the client will not use BranchCache. This is only applicable for accessing remote file shares and note web sites (not applicable for HTTP or BITS traffic).

To change this value, run this command :

Netsh branchcache smb set latency latency=20 ( this will configure the SMB latency to 20 ms)

Another important note that laptops on battery will not participate in BranchCache if it is participating in Distributed Cache mode. This is the default behavior to preserver power.

Content Server Hashes

As explained before, content servers are those servers with content that you want to cache content from. Examples are you WSUS server or File Share servers.

Those content servers will generate hashes for content that is requested only. So when the first client requests a certain file, the file is downloaded completely and the hashes start to generate on the server. You need three different clients to request the same file to start getting benefit from BranchCache.

Also note that hashes are generated for files bigger than 64k in size, so you will not benefit from BranchCache when dealing with files less than 64 in size.

Hashes on the content servers will be lost or deleted if the BranchCache service restarted. BranchCache service will then start generated hashes again when files are accessed.

If you are interested to know more about this nice technology, come here again and filter posts with (BranchCache) tag.

Note:This applies to Windows 7 and Windows 2008 R2. Separate post will mention what is new in Windows 8/2012

One comment on “BranchCache – Course 109: Where files are stored?!

  1. Nice info!
    However, the PublicationCache is still quite confusing. On my Content server (FileServer 2008R2 with fileserver and branchcache role installed and hashing generated for shared folders that are branchcache enabled) the hashing is done under “drive:\System Volume Information\SmbHashes”. So not what you mention as the “PublicationCache”.
    My clients (Windows 7 configured in distributed caching mode) have both the PeerDistPub & PeerDistRepub folder under C:\Windows\ServiceProfiles\NetworkService\AppData\Local.

Leave a Reply

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

You are commenting using your 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