These 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 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.” Like 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
- “CPU usage” in the following settings is based on “logical processors” in the physical or virtual machine. Each core in a CPU is considered as a logical processor, in the same way that Windows does. For example, a physical machine with one 6-core CPU is considered to have 12 logical processors (Hyper-Threading Technology means cores are doubled). A physical machine with 8 x CPUs, each with 12 cores, has 96 logical processors. A VM configured with two 4-core CPUs has 8 logical processors.
- The same applies to virtual machines. For example, suppose you have a physical machine with 8 x CPUs, each with 12 cores (96 logical processors), supporting four multi-session OS VDA VMs. Each VM is configured with two 4-core CPUs (8 logical processors). To restrict processes that trigger CPU spike protection on a VM, to use half of its cores, set Limit CPU Core Usage to 4 (half of the VM’s logical processors), not to 48 (half of the physical machine’s logical processors).
Enable CPU Spike Protection. Lowers the CPU priority of processes for a period of time (specified in the Idle Priority Time field) if they exceed the specified percentage of CPU usage for a period of time (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 there are 4 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 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 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 frequent 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:
- System Idle Process
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.
- 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, Norskale Agent Service, look for “Initializing process limitation thread for process”.
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.
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 to the CPU priority process list
- 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 I/O priority item
Select the process name and click Edit.
To remove a process from the I/O priority list
Select the process name and click Remove.
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 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.
- 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.
- 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.