Our LogicMonitor caught a Distributed File Service (DFS) alert:

Staging Folder For Replicated Folder Has Exceeded Its Configured Size

which leads to replication failure and that is bad.

When DFS was installed it was likely configured with the default 4GB “staging area” and in todays world that is unlikely to cut it.

What Is The DFS Staging Area?

The DFS Staging Area is just a folder on a Distributed File Service server that acts as the cache for files with changes that need to be replicated to other servers.

How Big Should The DFS Staging Area Be?

Microsoft says that your DFS staging folder should be larger than the 32 largest files on your shares combined. So if you have 10 files that about about 1GB each and 10 files about 100MB and 12 files about 50MB, your staging area should be set to about 12GB.

Fortunately Microsoft has a simple PowerShell tool to find and calculate that total for you:

$large32 = Get-ChildItem c:\\temp -recurse | Sort-Object length -descending | select-object -first 32 | measure-object -property length –sum

$large32.sum /1gb

If you want to know what those largest 32 files are, run this simple PowerShell command:

Get-ChildItem c:\temp -recurse | Sort-Object length -descending | select-object -first 32 | ft name,length -wrap –auto

For complete details on the size of the DFS Staging folder skim THIS Microsoft article.

How To Change The DFS Staging Area Size?

To change the DFS Staging Area Size:

  1. Launch DFS MANAGEMENT
  2. Expand REPLICATION (on the left)
  3. Click on one of the server pairs (on the left, under Replication)
  4. Right click on one of the REPLICATION FOLDER paths and select PROPERTIES
  5. Click the STAGING tab
  6. Set the QUOTA as you see fit
how to set dfs staging size

How To Check The DFS Replication Backlog

If you want to see what is waiting to be replicated by DFS:

  1. Launch a PowerShell as an Administrator
  2. Type Get-DfsrBacklog | select FileName,FullPathName,UpdateTime
  3. Type the name of the source computer and press the ENTER key
  4. Type the name of the destination server and press the ENTER key
how to check dfs replication backlog

How To Quickly Check the Health of Your DFS Server

Other than looking as the backlog report (explained above), there are three easy ways to make sure your DFS is working:

A – Test

Put a new file in a share that is being replicated and see if it quickly appears at on the other DFS server

B – Check the Topology

  1. Launch DFS MANAGEMENT
  2. Expand REPLICATION (on the left)
  3. Click on one of the server pairs (on the left, under Replication)
  4. Click VERIFY TOPOLOGY (in the ACTIONS meny on the right)

C – Run a DFS Diagnostic

  1. Launch DFS MANAGEMENT
  2. Expand REPLICATION (on the left)
  3. Click on one of the server pairs (on the left, under Replication)
  4. Click CREATE DIAGNOSTIC REPORT (in the ACTIONS menu on the right)

How To Force A Cleanup Of The DF Staging Area

In theory DFS staging should clean itself up and delete replicated files automatically when it fills 90% of the DFS Staging Area. However, you may want to force it to clean up.

We have not tested this but it makes sense:

1- Open a CMD prompt as an administrator on the DFSR server.
2- Get the GUID of the Replicated Folder you want to clean:

WMIC.EXE /namespace:\root\microsoftdfs path dfsrreplicatedfolderconfig get replicatedfolderguid,replicatedfoldername

3 – Then call the CleanupConflictDirectory method:

WMIC.EXE /namespace:\root\microsoftdfs path dfsrreplicatedfolderinfo where “replicatedfolderguid=”” call cleanupconflictdirectory

https://social.technet.microsoft.com/Forums/windows/en-US/d222264d-9ba7-4ece-9481-2069c5169d26/dfs-replication-database-is-getting-big?forum=winserverfiles


0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published.