Microsoft is making an important change about SMB in Windows 11. It’s about the compression functionality. It becomes more impactful which reduces the size of the files and thus the times needed to transfer data.
Windows 11 and Windows Servers 2022 take advantage of the SMB compression functionality. SMB is an acronym for Server Message Block. It is a communication protocol that supports data and printer sharing. We also find it when browsing the nets.
This compression reduces the file size during transfer. It avoids manual interventions. There is no need to compress data first, convert and then decompress everything on the target drive. The advantage of reducing the amount of data to be transferred is to save bandwidth. This is especially useful with networks with limited speeds such as Wi-Fi or 1 Gbps Ethernet if multi-gigabyte files are handled.
Unfortunately, this job respects certain rules that limit its actions and possibilities. For example, Microsoft has implemented a limit of 100MB for compression in the first 500MB of a file. As a result, small files do not benefit from this compression. Likewise, large file transfers can be affected if the first 500MB does not provide this level of compression.
Now this The rule no longer applies. SMB compression ignores the size of the data. Obviously, all files benefit from the compression request during transfer. Microsoft says, however, that not all files are “equal” when it comes to compression. Already compressed files, such as images in JPG format or archives in ZIP and RAR formats, do not benefit from this advance.
Windows 11 Compression and SMB, Details
Users, administrators, and applications can request compression. New PowerShell policies and commands can be used to control this feature.
Microsoft details
group policy
\Computer Configuration\Administrative Templates\Network\Lanman Workstation
- Disable SMB compression
- Use SMB compression by default
\Computer Configuration\Administrative Templates\Network\Lanman Server
- Disable SMB compression
- Traffic compression request for all posts
All of these write to the following location and will override the “native” registry settings as usual with group policy:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation\parameters
PowerShell for SMB . Client
Set-SMBClientConfiguration [-EnableCompressibilitySampling <bool>] [-CompressibilitySamplingSize <uint64>] [-CompressibleThreshold <uint64>] [-DisableCompression <bool>] [-RequestCompression <bool>]
- -disable compression $true or $false – Never press even if the server or application requests
- pressure request $true or $false – Always require compression even if not specified by the server or application
- – Enable sampling compressibility $true or $false – Controlling inherited sampling behavior
- – compressibility, sampling volume 1- 9,007,199,254,740,992 – Size in bytes of range to be sampled in a file looking for compressibility
- -pressure threshold- 1- 9,007,199,254,740,992 – Size in bytes of compressible data to be found within this range
You will not need to touch the sampling settings without good reason. Maybe hit me in the comments first if you feel the need to touch it up. 🙂 A keen reader may notice that a range of 9,007,199,254,740,992 is not Uint64 in PowerShell. This is because the real limit in the code is 9PiB, not the 184,467,440,737,095,551,615 bytes of the UInt64 value we had to set in Posh. If you have individual files larger than 9 petabytes, I’d love to hear your story, regardless!
These values are stored in the registry under:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\LanmanWorkstation\parameters
Noun | Good heart | shortening | border | PS Interface (Set-SmbClientConfiguration) |
EnableCompressedTraffic | REG_DWORD | 0 | 0 or 1 | pressure request |
Disable compression | REG_DWORD | 0 | 0 or 1 | Disable compression |
Enable pressure sampling | REG_DWORD | 0 | 0 or 1 | Enable pressure sampling |
compressibility | REG_QWORD | 0 | 0 to 8 GDP | compressibility |
compressible | REG_QWORD | 0 | 0 to 8 GDP | compressible |
PowerShell for SMB Server
Set-SmbServerConfiguration [-DisableCompression <bool>] [-RequestCompression <bool>]
- -disable compression $true or $false – Never press even if the customer asks
- pressure request $true or $false – Always ask for pressure even if the customer doesn’t specify it
These values are stored in the registry under:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\LanmanServer\parameters
Noun | Good heart | shortening | border | PS Interface (Set-SmbServerConfiguration) |
EnableCompressedTraffic | REG_DWORD | 0 | 0 or 1 | pressure request |
Disable compression | REG_DWORD | 0 | 0 or 1 | Disable compression |
This change will be published on Patch Tuesday in September 2022. If you want to take advantage of it now, you can manually run the download of the latest optional updates released by Microsoft. that it KB5016693 For Windows Server 2022 and KB5016691 for Windows 11.