Monday, June 27, 2011

Technical Deep Dive: XenApp Load Evaluators

By: Andy Paul

One of the often overlooked features of XenApp is truly understanding the load evaluators. As a consultant, I commonly see environments using only the Default Load Evaluator. If I am lucky, they might be using the Advanced Load Evaluator. Rarely do I find organizations actively monitoring or customizing their load evaluators.

Load Evaluators have not changed much since Presentation Server days, but amazingly they are not commonly optimized. Every environment and every workload is different, so whichever load evaluator is implemented may vary, but they should be customized and monitored.

Here is a screen shot of the XenApp 6 Advanced Load Evaluator, which is now the default assignment. It creates a load based on CPU Utilization, Load Throttling, Memory Usage and Page Swaps. The Default Load Evaluator (assigned by default in XenApp 5 and prior versions) measures Server User Load.

I generally recommend creating a custom load evaluator based on resources, usually CPU Utilization, Load Throttling, Memory Usage and possibly Server User Load. This way, I can spread the load across servers based on number of users, resource loads and help prevent login storms.

Understanding Loads
But assigning a Load Evaluator is only part of the battle. You must also understand what and how that load is calculated. A simple QFARM /LOAD will show you server loads (or QFARM /LTLOAD to see the server resource load without calculating Load Throttling.) However, if you are using a load evaluator with multiple components, what is causing the load? The base algorithm for establishing actual load is Highest_Load + (Average_Other_Loads * .1).

Assuming you have a load evaluator monitoring CPU Utilization, Memory Usage and Load Throttling, and you see a server with a 7800 load value, it may be dangerously close to 10000 (Full Load) since that 7800 is not the aggregate of all loads, but reflective of the highest load, which could be close to reporting full. In this case, perhaps that server is running at 78% Memory Usage, with a cap set to 80% in the load evaluator… one more process may send it over the edge.

Detailed Load Monitoring
So what can you do about it? Knowing your environment is key, as is monitoring actual loads and adjusting evaluators or adding capacity as necessary. To this end, you can run real-time analysis of the various components of a load evaluator using the QUERYDS tool from Citrix. Additional information is available under CTX112082. These were originally published for Presentation Server 4.0, but are still valid for all editions, including XenApp 6. Please note, the output from QUERYDS will be hex values, and will need to be converted. Most applications include a Hex-Decimal conversion function, or you can use a free online converter such as http://easycalculation.com/hex-converter.php

The following table identifies the code values of the different load evaluator properties:
a -- Application User Load
2 -- Context Switches
1 -- CPU Utilization
7 -- Disk Data l/O
8 -- Disk Operations
9 -- IP Range
d -- Load Throttling
3 -- Memory Usage
4 -- Page Faults
6 -- Page Swaps
5 -- Scheduling
b -- Server User Load

Using this information, take the sample below; consisting of three servers:

Server TEST02 has a load of 1610 (HEX 64a). This load is comprised of:
  • Server User Load: 2 (b:2)
  • Load Throttling: 0 (d:0)
  • Memory Usage: 16 (3:10)
  • CPU Utilization: 0 (1:0)
These are percentages of 100, so a Memory Usage load of 16 is a load value of 1600. Load Throttling is not calculated since there is no current logon event. That leaves the average of Server User Load and CPU Utilization (200+0)/2*.1 = 10. This makes the total load value of 1610.

Conclusion
Now that you have a way to view the load components (QUERYDS) and an understanding on how to interpret the results, these values can be read and automated into a monitoring solution - either real-time or historical. Once a baseline is established, alerts can be generated as values approach full loads. Based on this information, you can then decide if you should modify your evaluators or add capacity.


Additional Reading:
blog comments powered by Disqus
Microsoft Virtualization, Citrix, XENServer, Storage, iscsi, Exchange, Virtual Desktops, XENDesktop, APPSense, Netscaler, Virtual Storage, VM, Unified Comminications, Cisco, Server Virtualization, Thin client, Server Based Computing, SBC, Application Delivery controllers, System Center, SCCM, SCVMM, SCOM, VMware, VSphere, Virtual Storage, Cloud Computing, Provisioning Server, Hypervisor, Client Hypervisor.