Microsoft improves SMB compression in Windows 11 and Server 2022
Microsoft released optional updates for the company's Windows 11 and Windows Server 2022 operating systems earlier this month. One of the new features of the releases reveals that the operating systems compress files now regardless of size.
When Microsoft released Windows 11 and Windows Server 2022, it included SMB compression capabilities. SMB, which stands for Server Message Block, is a communication protocol that supports file and printer sharing, network browsing, and more.
SMB compression aims to reduce the size of files that are transferred using SMB. The initial release in Windows 11 and Server 2022 introduced compression but had strict rules regarding it.
SMB compression allows an administrator, user or application to request compression of files as they transfer over the network. This removes the need to first manually deflate a file with an application, copy it, then inflate on the destination computer. Compressed files will consume less network bandwidth and take less time to transfer, at the cost of slightly increased CPU usage during transfers. SMB compression is most effective on networks with less bandwidth, such as a client's 1Gbps ethernet or Wi-Fi network; a file transfer over an uncongested 100Gbps ethernet network between two servers with flash storage may be just as fast without SMB compression in practice, but will still create less congestion for other applications.
In essence, SMB compression ignored a good number of files, even though transfers would have benefitted from the compression of these files.
Microsoft implemented a threshold of 100 MiB that needed to be compressible in the first 500 MiB of a file. This meant that smaller files would not benefit from the compression feature. Large file transfers could suffer as well, if the first 500 MiB were not as compressible.
Now, with the update released, SMB Compression ignores size. All files will benefit from requests to compress files before transferring them.
Microsoft concedes that all files are not equal when it comes to compression. Already compressed file types, such as JPG or ZIP, do not benefit much, if at all, from the compression feature. Other file types, including ISO or VHDX, will usually benefit from it.
Users, administrators and apps may request compression. Administrators may use new policies and PowerShell commands to control the functionality.
\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
Request traffic compression for all shares
PowerShell for SMB client
Set-SMBClientConfiguration [-EnableCompressibilitySampling <bool>] [-CompressibilitySamplingSize <uint64>] [-CompressibleThreshold <uint64>] [-DisableCompression <bool>] [-RequestCompression <bool>]
-DisableCompression $true or $False - never compress even if server or application requested
-RequestCompression $true or $false - always request compression even if server or application didn't specify it
-EnableCompressibilitySampling $true or $false - control legacy sampling behavior
-CompressibilitySamplingSize 1- 9,007,199,254,740,992 - size in bytes of range to sample in a file looking for compressibility
-CompressibleThreshold - 1- 9,007,199,254,740,992 - size in bytes of compressible data that must be found within that range
Additional information is available on the linked resources above.
The updates will be included in the September 2022 Patch Tuesday cumulative updates, which will be released on September 13, 2022.Advertisement