If you are a XenApp administrator you have no doubt utilized “qfarm.exe /load” to display the load on your Citrix XenApp Servers. These load values can identify issues with your servers in addition to determining which server is the least/most loaded in your farm. The one key component missing in this display is determining the reason for the load evaluator value.

 

image

This is where Windows PowerShell comes into play. If you haven’t already, you need to download the Citrix XenApp Commands Technology Preview (v2). You must be running XenApp 5 on either W2k3 or W2k8.

Note: XenApp 6 comes with this PSSnapin preinstalled as part of the core software. However as you will soon see the features are not the same.

Once you have installed the Citrix PSSnapin, power up PowerShell and run the following commands:

Add-PSSnapin Citrix.XenApp.Commands
Get-XAZone | Get-XAServer -onlineonly | Get-XAServerLoad | format-table -auto

The first line imports the XenApp commands. “Get-XaZone | Get-XAServer –onlineonly” is included to only return servers that are currently online. If the Get-XAServerLoad cmdlet is run and encounters a server that is offline, it will error out and stop the whole process. (Not the way I would have it handled, but that is for another day. ). Once it is run you will get a display similar to below.

image

As you can see you not only got the Load value, but you also got the value for each component that made up the rule.  In the first example you can see that the memory is at 11% which is contributing to the load of 1100. This information has been invaluable in a couple of different instances; one where the box was responding, but the Load Throttling was keeping the server from taking connections, and another where I discovered that Page Swaps were hammering one of the servers.

DISCLAIMER: The Get-XAServerLoad that is included with the PSSnapin in XenApp 6 does NOT include the Rules property. I discovered this fact while working on this blog post. I have no clue why it was removed, but I will try and find out.