Handle Caching on Continuous Availability Shares
Mise en cache du handle sur des partages Disponibilité continue
Explanation
This policy setting determines the behavior of SMB handle caching for clients connecting to an SMB share where the Continuous Availability (CA) flag is enabled.
If you enable this policy setting, the SMB client will allow cached handles to files on CA shares. This may lead to better performance when repeatedly accessing a large number of unstructured data files on CA shares running in Microsoft Azure Files.
If you disable or do not configure this policy setting, Windows will prevent use of cached handles to files opened through CA shares.
Note: This policy has no effect when connecting Scale-out File Server shares provided by a Windows Server. Microsoft does not recommend enabling this policy for clients that routinely connect to files hosted on a Windows Failover Cluster with the File Server for General Use role, as it can lead to adverse failover times and increased memory and CPU usage.
Ce paramètre de stratégie détermine le comportement de la mise en cache du handle SMB pour les clients se connectant à un partage SMB sur lequel l’indicateur Disponibilité continue (CA) est activé.
Si vous activez ce paramètre de stratégie, le client SMB autorise les handles mis en cache sur des fichiers de partages CA. Ceci permet d’obtenir de meilleures performances lorsque vous accédez de manière répétée à un grand nombre de fichiers de données non structurés sur des partages CA exécutés dans des fichiers Microsoft Azure.
Si vous désactivez ce paramètre de stratégie ou si vous ne le configurez pas, Windows empêche l’utilisation de handles mis en cache sur des fichiers ouverts via des partages CA.
Remarque : cette stratégie n’a aucun effet lorsque vous vous connectez à des partages de serveur de fichiers avec montée en puissance parallèle. Microsoft recommande de ne pas activer cette stratégie pour des clients se connectant régulièrement à des fichiers hébergés sur un cluster de basculement Windows avec le rôle Serveur de fichiers pour une utilisation générale, car ceci peut affecter le temps basculement et augmenter l’utilisation de la mémoire et de l’UC.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\LanmanWorkstation- Value name
EnableHandleCachingForCAFiles
| State | Value written |
|---|---|
| Enabled | REG_DWORD = 1 |
| Disabled | REG_DWORD = 0 |
PowerShell
PowerShell commands that write to the registry what the policy would write. Values in angle brackets (<…>) must be replaced.
Writing directly to the registry bypasses Group Policy: if a GPO manages this value, it will be rewritten at the next gpupdate; otherwise the value stays in place (the "tattooing" effect). Prefer a GPO or, locally, LGPO.exe. Run PowerShell as administrator for HKLM. Some policies need a restart or gpupdate /force.
Enable
# Enable: LanmanWorkstation/Pol_EnableHandleCachingForCAFiles
$k = 'HKLM:\Software\Policies\Microsoft\Windows\LanmanWorkstation'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'EnableHandleCachingForCAFiles' -Value 1 -Type DWordDisable
# Disable: LanmanWorkstation/Pol_EnableHandleCachingForCAFiles
$k = 'HKLM:\Software\Policies\Microsoft\Windows\LanmanWorkstation'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'EnableHandleCachingForCAFiles' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": LanmanWorkstation/Pol_EnableHandleCachingForCAFiles
$k = 'HKLM:\Software\Policies\Microsoft\Windows\LanmanWorkstation'
Remove-ItemProperty -Path $k -Name 'EnableHandleCachingForCAFiles' -ErrorAction SilentlyContinue