Tuning Windows 2012 – Remote Desktop Session Host – Part 2

Most of the CPU usage on an RD Session Host system is driven by applications. Desktop applications are usually optimized toward responsiveness with the goal of minimizing how long it takes an application to respond to a user request. However in a server environment, it is equally important to minimize the total amount of CPU usage that is needed to complete an action to avoid adversely affecting other sessions.


Below are some considerations and suggestions when configuring applications that are to be used on an RD Session Host system:


Minimize background idle loop processing – Typical examples are disabling background grammar and spell check, data indexing for search, and background saves.
Minimize how often an application performs a state check or update – Disabling such behaviors or increasing the interval between polling iterations and timer firing significantly benefits CPU usage because the effect of such activities is quickly amplified for many active sessions. Typical examples are connection status icons and status bar information updates.
Minimize resource contention between applications by reducing their synchronization frequency – examples of such resources include registry keys and configuration files. Examples of application components and features are status indicator (like shell notifications), background indexing or change monitoring, and offline synchronization.

Disable unnecessary processes that are registered to start with user sign-in or a session startup – These processes can significantly contribute to the cost of CPU usage when creating a new user session, which generally is a CPU-intensive process, and it can be very expensive in morning scenarios. Use MsConfig.exe or MsInfo32.exe to obtain a list of processes that are started at user sign-in.


To optimize memory consumption, consider the following suggestions:


Verify that the DLLs that applications load are not relocated. If DLLs are relocated, it is impossible to share their code across sessions, which significantly increases the footprint of a session. This is one of the most common memory-related performance issues in RD Session Host.
For common language runtime (CLR) applications, use Native Image Generator (Ngen.exe) to increase page sharing and reduce CPU overhead. When possible, apply similar techniques to other similar execution engines.





Insufficient page file size can cause memory allocation failures in applications or in system components. A general guideline is that the combined size of the page files should be two to three times larger than the physical memory size. You can use the memory-to-committed bytes performance counter to monitor how much committed virtual memory is on the system.


When the value of this counter reaches close to the total combined size of physical memory and page files, memory allocation begins to fail. Because of significant disk I/O activity that page file access generates, consider using a dedicated storage device for the page file, ideally a high-performance storage device such as a striped RAID array.


In part 3 of this article, we’ll discuss RD Host Session optimization taking Anti Virus software and Task Scheduler into consideration.