Summary
CPU Utilization Management was introduced with Citrix Presentation Server 4.0. This FAQ article covers the feature in depth.
Q: What is the CPU Utilization Management feature designed to do?
It is a feature of Presentation Server 4.0 and 4.5 designed to give each user a fair share of the CPU by modifying the normal job priority scheduling in the operating system. CPU time is allocated fairly across all users on the server. It normalizes the CPU usage of each user by smoothing out the normal CPU peaks that most applications have. It limits very CPU-intensive applications to a fair share of the CPU, so that one user does not inadvertently have an inappropriate adverse affect on the other users. This enables administrators to easily calculate how many users can fit on a machine at once and hence how many machines must be purchased.
Q: What is a share?
A share is a relative percentage of the CPU that each user receives. By default, each user is assigned eight shares. The percentage of CPU time that a user gets is relative because it is dependent on the number of users that are logged on to a particular server. For example, if there are four users logged on to a system and each user has eight equal shares, that means each user receives 25 percent of the CPU. If there are 10 users logged on, each user receives 10 percent. This is a "soft limit," and if the user is not using all of the CPU time allotted to him/her, other users can borrow it. Likewise, the user can borrow CPU time from other users as well if needed and if CPU time is available.
Q: What is a reservation?
A CPU reservation sets aside a specific percentage of the entire CPU resource that will always be made available to the user if needed. This is a "soft limit," and if the user is not using all of the CPU time allotted to him/her, other users can borrow it. By default, 20 percent of one CPU is set aside for the System Context which, on a single CPU machine, leaves the remaining 80 percent to be divided into shares.
Note: On a dual CPU machine, 20 percent of one CPU is equivalent to 10 percent of the entire CPU resource on that machine. On a quad CPU machine, 20 percent of one CPU is equivalent to 5 percent of the entire CPU on that machine, and so on.
Q: What edition of Presentation Server supports this feature?
Citrix Presentation Server 4.0 and 4.5 Enterprise Edition support this feature.
Note: An Enterprise Edition license file must be on the license server.
Q: How does the CPU Utilization Management feature work?
It is enabled in the Access Management Console in the server-default or server properties under Memory/CPU Utilization Management. Once the feature is enabled, one or more services will be started. On Presentation Server 4.0 the Citrix CPU Utilization Mgmt/Resource Mgmt and Citrix CPU Utilization Mgmt/User-Session Sync services are started. On Presentation Server 4.5 only the Citrix CPU Utilization Mgmt/Resource Mgmt service is started, as the functionality that was previously provided by the Citrix CPU Utilization Mgmt/User-Session Sync services has been included in the Citrix CPU Utilization Mgmt/Resource Mgmt service; the Citrix CPU Utilization Mgmt/User-Session Sync service no longer exists. The Citrix CPU Utilization Mgmt/Resource Mgmt service monitors users and processes, calculates load, and makes operating system calls to set the CPU priority of processes. The Citrix CPU Utilization Mgmt/User-Session Sync service ensures that all processes associated with a user’s session get associated with that user when determining the load. This service is necessary to keep track of processes that normally run under the system context, such as CSRSS.exe and winlog.exe, and to make sure that they are reported under the correct user session for load calculation.
Q: How do you verify how much CPU each user is using?
You can use Performance Monitor to see the average CPU usage for each user session. There is a new Performance Monitor object called Citrix CPU Utilization Mgmt User with five specific counters called CPU Entitlement, CPU Reservations, CPU Shares, CPU Usage, and Long term CPU Usage, which should help an administrator verify the functionality of the feature. You can also use the CPU Optimization Report in the Report Center in the Access Management Console to create a report detailing CPU Usage per user. This report does require a connection to a Resource Manager Summary Database.
Q: Can you assign more CPU shares or create a reservation for a user?
Yes. The default share for each user is eight and a default reservation of 20 percent of one CPU has been set aside for the System Context. Modifying the default values is not necessary, however if an administrator chooses to do so they can go to multi-string registry key HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\CTXCPU <Policy>.
To assign a user a specific number of shares, add the following line under the <Policy> value:
Domain\u1,cpu.shares=# (where # represents the number of shares to be assigned)
To create a reservation for a user, add the following line under the <Policy> value:
Domain\u2,cpu.reservation=# (where # represents the percentage in thousands. For example, to assign 10 percent of the entire CPU resource to a user set the value to 10000)
Once changes have been made to the CTXCPU key in the registry, for the changes to take effect, restart the Citrix CPU Utilization Mgmt/Resource Mgmt service. To verify that the changes are in effect, use Performance Monitor with the object and counters specified above.
When modifying the registry key the format is very important. The user name has to be written in the domain name or the server name\username format. Shares can only fall in the range of 1-64. A reservation’s percentage is represented in thousands, that is the entire CPU resource of a machine is 100 percent, and this would be represented by 100000 (this is the same irrespective of the number of CPU on the machine). The sum of all reservations cannot exceed 99 percent (99000) and by implication the maximum value for a single reservation is also 99 percent (99000). Administrators must do their own base line testing to find out what numbers would achieve the required performance.
Q: Can you assign more CPU shares or reservations to a group?
No. You can only assign shares and reservations to users, not groups.
Q: Can you assign shares or reservations for applications?
No. Note that you cannot use the CPU prioritization setting in the properties of a published application to set an application’s CPU priority, as this will be implicitly overridden by the mechanism that CPU Utilization Management feature uses to share CPU resource amongst users.
Q: Are the “Citrix CPU Utilization Mgmt/Resource Mgmt” and “Citrix CPU Utilization Mgmt/User-Session Sync” services dependent on the IMA Service?
Yes. Both services are stopped and started by the IMA Service once the feature is enabled or disabled. When looking at the properties of the services in the Services Manager you will see that they are set to manual because they are controlled by the IMA Service. However if the IMA Service fails to start then both services will not be automatically started but they can be started manually. Note that restarting the IMA Service results in these two services also being restarted.
Q: Is there a list of applications that are incompatible with this feature?
No. All applications should function with this feature, although it is known that Norton's antivirus products may complain about interference from this feature, see CTX113486 – Error: SYMANTEC TAMPER PROTECTION ALERT Points to CPU Utilization Management Executables.
Q: What are the "CPU Utilization Management / CPU Rebalancer" services designed to do?
See page 149 of CTX107059 – Advanced Concepts Guide for Presentation Server 4.0 and page 246 of CTX112223 – Citrix Presentation Server 4.5 Administrator's Guide.
The services used for CPU Utilization Management are CTXCPUUtilMgmt User/Session Synchronization and CTXCPUUtilMgmt Resource Management. In addition to these two services, the Citrix CPU Utilization Mgmt/CPU Rebalancer service is installed on Windows Server 2003 multi-processor systems; it is not installed on Windows 2000 Server or servers with only one processor. This CPU Rebalancer service is used in rare cases to handle CPU intensive applications correctly. Because the CPU Rebalancer service has the potential of impacting server performance, by default it is set to Manual. If CPU intensive applications are running in your environment and they all appear to be running on the same CPU, setting this service to Automatic is recommended. The CPU Rebalancer service corrects this by balancing the load equally across processors.
From CTX111419 – Hotfix Rollup Pack PSE400W2K3R03 - For Citrix Presentation Server 4.0, Citrix Access Essentials 1.0 and 1.5 for Windows Server 2003 :
"The Citrix CPU Utilization Management/CPU Rebalancer Service might not start after restarting a server. When this happens, an incomplete error message similar to the following appears in the application event log. This fix adds the missing text to clarify the error message.
"(7460,8454,8455,8456, or 8457)The description for Event ID ( ) in Source ( CTXCPUUtilMgmt ) cannot be found. The local computer might not have the necessary registry information or message DLL files to display messages from a remote computer. You might be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: ."
[From PSE400W2KR03][#137680]"