CPU Management
The following settings let you optimize CPU usage.
CPU management settings
Processes can run across all cores and can use up as much CPU as they want. In Workspace Environment Management (WEM), CPU Management Settings lets you limit how much CPU capacity individual processes can use. CPU spike protection is not designed to reduce overall CPU usage. It is designed to reduce the impact on user experience by processes that consume an excessive percentage of CPU Usage.
When CPU spike protection is enabled, if a process reaches a specified threshold, WEM automatically lowers the priority of the process for a certain time. Then, when a new application is launched, it has a higher priority than the lower-priority process and the system will continue to run smoothly.
CPU spike protection examines each process in a quick “snapshot.” If the average load of a process exceeds the specified usage limit for a specified sample time, its priority reduces immediately. After a specified time, the process’ CPU priority returns to its previous value. The process is not “throttled.” Unlike in CPU Clamping, only its priority is reduced.
CPU spike protection is not triggered until at least one instance of an individual process exceeds the threshold. In other words, even if total CPU consumption exceeds the specified threshold, CPU spike protection is not triggered unless at least one process instance exceeds the threshold. But when that process instance triggers CPU spike protection, new instances of the same process are (CPU) optimized when the option “Enable Intelligent CPU Optimization” is enabled.
Whenever a specific process triggers CPU spike protection, the event is recorded in the agent’s local database. The agent records trigger events for each user separately. This means that CPU optimization for a specific process for user1 does not affect the behavior of the same process for user2.
For example, if Internet Explorer is sometimes consuming 50–60% of CPU, you can use CPU spike protection to target only those iexplore.exe instances that are threatening VDA performance. (By contrast, CPU clamping would apply to all processes.)
We recommend that you experiment with the sample time to decide the optimal value for your environment that does not affect other users logged on to the same VDA.
CPU Spike Protection
Note:
- CPU usage in the following settings is based on logical processors in the physical or virtual machine. The total number of logical processors can be obtained from the system information of either the physical machine or the virtual machine. If a physical machine or a VM has a total of 48 logical processors, restricting the processes that trigger CPU spike protection on the physical machine or the VM to use half of its cores, set the limit of the CPU core usage to 24.
Enable CPU Spike Protection. Lowers the CPU priority of processes for a period (specified in the Idle Priority Time field) if they exceed the specified percentage of CPU usage for a period (specified in the Limit Sample Time field).
-
Auto Prevent CPU Spikes. Use this option to automatically reduce the CPU priority of processes that overload your CPU. This option automatically calculates the threshold value at which to trigger CPU spike protection based on the number of logical processors (CPU cores). For example, suppose that there are four cores. With this option enabled, if the overall CPU usage exceeds 23%, the CPU priority of processes that consume more than 15% of the overall CPU resources reduces automatically. Similarly, in the case of 8 cores, if the overall CPU usage exceeds 11%, the CPU priority of processes that consume more than 8% of the CPU resources reduces automatically.
-
Customize CPU Spike Protection. Lets you customize settings for CPU spike protection.
- CPU Usage Limit. The percentage of CPU usage that any process instance must reach to trigger CPU spike protection. This limit is global across all logical processors in the server, and is determined on an instance-by-process basis. Multiple instances of the same process do not have their CPU usage percentages added when determining CPU spike protection triggers. If a process instance never reaches this limit, CPU spike protection is not triggered. For example, on a Server VDA, in multiple concurrent sessions, suppose that there are many iexplore.exe instances. Each instance peaks at around 35% CPU usage for periods of time, so that cumulatively, iexplore.exe is consistently consuming a high percentage of CPU usage. However, CPU spike protection is never triggered unless you set the CPU Usage Limit at or below 35%.
- Limit Sample Time. The length of time for which a process must exceed the CPU usage limit before its CPU priority is lowered.
-
Idle Priority Time. The length of time for which the CPU priority of the process is lowered. After that time, the priority returns to one of the following:
- The default level (Normal) if the process priority is not specified on the CPU Priority tab and the Enable Intelligent CPU Optimization option is not selected.
- The specified level if the process priority is specified on the CPU Priority tab, regardless of whether the Enable Intelligent CPU Optimization option is selected.
- A random level depending on the behavior of the process. This case occurs if the process priority is not specified on the CPU Priority tab and the Enable Intelligent CPU Optimization option is selected. The more frequently the process triggers CPU spike protection, the lower its CPU priority is.
Enable CPU Core Usage Limit. Limits processes that trigger CPU spike protection to a specified number of logical processors on the machine. Type an integer in the range of 1 through X, where X is the total number of cores. If you type an integer greater than X, WEM limits the maximum consumption of isolated processes to X by default.
- Limit CPU Core Usage. Specifies the number of logical processors to which processes that trigger CPU spike protection are limited. In the case of VMs, the value you type limits the processes to the number of logical processors in the VMs rather than in the underlying physical hardware.
Enable Intelligent CPU Optimization. When enabled, the agent intelligently optimizes the CPU priority of processes that trigger CPU spike protection. Processes that repeatedly trigger CPU spike protection are assigned progressively lower CPU priority at launch than processes that behave correctly. Note that WEM does not perform CPU optimization for the following system processes:
- Taskmgr
- System Idle Process
- System
- Svchost
- LSASS
- Wininit
- services
- csrss
- audiodg
- MsMpEng
- NisSrv
- mscorsvw
- vmwareresolutionset
Enable Intelligent I/O Optimization. When enabled, the agent intelligently optimizes the process I/O priority of processes that trigger CPU spike protection. Processes that repeatedly trigger CPU spike protection are assigned progressively lower I/O priority at launch than processes that behave correctly.
Exclude Specified Processes. By default, WEM CPU management excludes all of the most common Citrix and Windows core service processes. You can, however, use this option to Add or Remove processes from an exclusion list for CPU spike protection by executable name (for example notepad.exe). Typically, antivirus processes would be excluded.
Tip:
- To stop antivirus scanning taking over disk I/O in the session, you can also set a static I/O Priority of Low for antivirus processes, see I/O Management.
- When processes trigger CPU spike protection, and process CPU priority is lowered, WEM logs a warning each time it lowers the CPU priority of a process. In the Event Log, in Application and Services Logs, WEM Agent Service, look for “Initializing process limitation thread for process”.
CPU spike protection option
Choose how you want to enforce CPU spike protection:
-
Automatically prevent CPU spikes. Use this option to let the agent perform CPU spike protection when the system CPU usage (relative to a single CPU core) exceeds 90% and the process CPU usage (relative to a single CPU core) exceeds 80%.
-
Customize CPU spike protection. Lets you customize settings for CPU spike protection.
- CPU usage limit. The percentage of CPU usage that any process instance must reach to trigger CPU spike protection. This limit is global across all logical processors on the server, and is determined on an instance-by-process basis. To configure the limit based on a single CPU core as a reference, use the Set limit relative to single CPU core option.
Note:
- Both integer and non-integer values are supported. By entering a non-integer value, for example 37.5%, you restrict processes that use more than three cores on an eight-core platform.
- Set limit relative to single CPU core. Lets you set a limit on CPU usage based on a single CPU core as a reference. The value can be greater than 100%, for example, 200% or 250%. Example: When the value is set to 200%, the agent optimizes processes that use two or more CPU cores. Both integer and non-integer values are supported. You can configure the Set limit relative to single CPU core setting only for the WEM Web console.
- With Customize CPU spike protection configured, CPU spike protection is triggered when either the global CPU usage limit or the CPU usage limit relative to a single CPU core is reached, whichever occurs first.
For processes that trigger CPU spike protection, the agent can do the following:
- If the Enable CPU core usage limit option is not selected: The agent lowers the CPU priority of those processes.
- If the Enable CPU core usage limit option is selected: The agent lowers the CPU priority of those processes and limits them to the specified number of logical processors on the machine.
When configuring CPU spike protection, keep the following in mind:
- Multiple instances of the same process do not have their CPU usage percentages added when determining CPU spike protection triggers. If a process instance never reaches this limit, CPU spike protection is not triggered. For example, in the case of a multi-session VDA with multiple concurrent sessions, there are multiple chrome.exe processes. Their CPU usage is not summed together when calculating the CPU usage.
Sampling time for CPU spike protection
Sample time limit. The length of time for which a process must exceed the CPU usage limit before CPU spike protection is enforced.
Priority lowering time for CPU spike protection
Idle priority time. The length of time for which the CPU priority of the process is lowered. After that time, the priority returns to one of the following:
The default level (Normal), if the process priority is not specified in the CPU priority tile and the Enable intelligent CPU optimization option is not selected. The specified level, if the process priority is specified in the CPU priority tile, regardless of whether the Enable intelligent CPU optimization option is selected. The calculated random level, depending on the behavior of the process. This case occurs if the process priority is not specified in the CPU priority tile and the Enable intelligent CPU optimization option is selected. The more frequently the process triggers CPU spike protection, the lower its CPU priority is.
Additional options
Enable CPU core usage limit. Use this option to limit processes that trigger CPU spike protection to a specific number of logical processors on the machine.
CPU priority
These settings take effect if processes are competing for a resource. They let you optimize the CPU priority level of specific processes, so that processes that are contending for CPU processor time do not cause performance bottlenecks. When processes compete with each other, processes with lower priority are served after other process with a higher priority. They are therefore less likely to consume such a large share of the overall CPU consumption.
The process priority you set here establishes the “base priority” for all of the threads in the process. The actual, or “current,” priority of a thread might be higher (but is never lower than the base). When a number of processes are running on a computer, the processor time is shared between them based on their CPU priority level. The higher the CPU priority level of a process is, the more the processor time is assigned to it.
Note:
The overall CPU consumption does not necessarily decrease if you set lower CPU priority levels on specific processes. There might be other processes (with higher CPU priority) still affecting percentage CPU usage.
Enable Process Priority. When selected, lets you set CPU priority for processes manually.
To add a process
- Click Add and type details in the Add Process CPU Priority dialog box.
- Click OK to close the dialog box.
-
Click Apply to apply the settings. Process CPU priorities you set here take effect when the agent receives the new settings and the process is restarted.
Process Name. The process executable name without the extension. For example, for Windows Explorer (explorer.exe) type “explorer”.
CPU Priority. The “base” priority of all threads in the process. The higher the priority level of a process is, the more the processor time it gets. Select from Realtime, High, Above Normal, Normal, Below Normal, and Low.
To edit a process
Select the process and click Edit.
To remove a process
Select the process and click Remove.
CPU affinity
Enable Process Affinity. When enabled, lets you define how many “logical processors” a process uses. For example, you can restrict every instance of Notepad launched on the VDA to the number of cores defined.
CPU clamping
CPU clamping prevents processes using more than a specified percentage of the CPU’s processing power. WEM “throttles” (or “clamps”) that process when it reaches the specified CPU percentage you set. This lets you prevent processes from consuming large amounts of CPU.
Note:
- CPU clamping is a brute force approach that is computationally expensive. To keep the CPU usage of a troublesome process artificially low, it is better to use CPU spike protection, at the same time as assigning static CPU priorities and CPU affinities to such processes. CPU clamping is best reserved for controlling processes that are notoriously bad at resource management, but that cannot stand to be dropped in priority.
- After you apply a percentage of the CPU’s processing power for a process and configure a different percentage for the same process later, select Refresh Agent Host Settings for the change to take effect.
The clamping percentage you configure is applied to the total power of any individual CPU in the server, not to any individual core it contains. (In other words, 10% on a quad-core CPU is 10% of the entire CPU, not 10% of one core).
Enable Process Clamping. Enable process clamping.
Add. Add the process by executable name (for example, notepad.exe).
Remove. Remove the highlighted process from the clamping list.
Edit. Edit the values typed for a given process.
Tip:
- When WEM is clamping a process, it adds the process to its watchlist the WEM client initializes. You can verify that a process is clamped by viewing this.
- You can also verify that CPU clamping is working by looking at process monitor and confirming that CPU consumption never rises above the clamping percentage.