Better performance for Server 2016 and 2019, starting now?

Memory Compression

WWhile I was recently searching the internet for information on Server 2016 performance issues, I came across an interesting article from Microsoft explaining a new optimization in Windows. This new feature has actually been around since Windows 7, but it has been further developed and was only enabled by default in the Windows 10 client version. Unlike the client version, this feature was disabled in the 2016 and 2019 server editions, but it can be enabled via a simple PowerShell command. Unfortunately, I couldn’t find any information about this feature in the context of multi-user systems (Remote Desktop Services). So I wondered whether this feature might also enable an immediate improvement in performance or user experience on session hosts. Some of my clients are currently testing this, and I’m waiting for their results. Would you like to do the same?

„What function is that?" you ask. The function is called "Memory Compression“and is enabled by default in Windows 10. Open Windows Task Manager, go to Performance, then Memory, and you’ll find: in use (compressed).

Blog Mc 01

Which memory is compressed, and how can this improve performance on a session host? Compressed memory is the memory area that would have been written to the page file but is instead stored compressed in memory; that is, instead of being stored uncompressed on the hard drive, it is stored compressed in memory. According to Microsoft, Windows can compress and decompress very efficiently and quickly, making it significantly faster than writing to or reading from the hard drive. The Windows operating system begins paging immediately, regardless of how much RAM is available. When Windows experiences „stress“ with RAM („stress“ is a term used by Microsoft, and I believe I once read that this occurs at approximately 70% RAM usage), Windows writes significantly more to the swap file. This results in the CPU also being under greater load. In this case as well helps compress the RAM, since compressed data is now stored on the hard drive are written in compressed form rather than uncompressed. This results in fewer and shorter read and write operations.
 
File servers, print servers, mail servers, etc., will not benefit from RAM compression because their RAM usage patterns are not highly dynamic; this is why the feature has been disabled. As we all know, multi-user systems (Remote Desktop Services) behave more like multiple workstations, with many applications and greater dynamics when it comes to memory usage. Therefore, session hosts utilize paging significantly more, and thus also benefit from using memory compression.
 
Microsoft states the following:
“The new memory compression concepts should help make Windows 10 appear snappier and more responsive than earlier versions, even on existing hardware.”
 
I am convinced that the same applies to multi-user systems and should be enabled by default when the RDS role is installed!
 
Memory compression can be enabled using the following PowerShell command: Enable-MMagent -MemoryCompression This means that a restart is not necessary, not even with active users on the system. Depending on RAM usage, the compressed portion in Task Manager should increase.

 

Blog Mc 02

Since the previous screenshot, I've enabled compression and opened a few applications. There is still plenty of RAM available (17.6 GB), but Windows has started paging, this time compressed into RAM!

What do you think? Let me know if you've tried Memory Compression! I'm curious to hear about your experiences with Memory Compression!

 

References 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top