Administration

Table Of Contents
Writing a Load Balancing Script for an RDS Host
You can write a load balancing script to generate a load value based on any RDS host metric that you want
to use for load balancing. You can also write a simple load balancing script that returns a fixed load value.
Your load balancing script must return a single number from 0 to 3. For descriptions of the valid load
values, see “Load Values and Mapped Load Preferences,” on page 165.
If at least one RDS host in the farm returns a valid load value, View Connection Server assumes a load value
of 2 (mapped load preference of MED) for the other RDS hosts in farm until their load balancing scripts
return valid values. If no RDS host in the farm returns a valid load value, the load balancing feature is
disabled for the farm.
If your load balancing script returns an invalid load value or does not finish running within 10 seconds,
View Agent sets the load preference to BLOCK and the RDS host state to configuration error. These values
effectively remove the RDS host from the list of RDS hosts available for new sessions.
Copy your load balancing script to the View Agent scripts directory (C:\Program Files\VMware\VMware
View\Agent\scripts) on each RDS host in the farm. You must copy the same script to every RDS host in the
farm.
For an example how to write a load balancing script, see the sample scripts in the View Agent scripts
directory. For more information, see “Sample Load Balancing Scripts for RDS Hosts,” on page 166.
Sample Load Balancing Scripts for RDS Hosts
When you install View Agent on an RDS host, the installer places sample load balancing scripts in the View
Agent scripts directory (C:\Program Files\VMware\VMware View\Agent\scripts).
Table 93. Sample Load Balancing Scripts
Name Description
cpuutilisation.vbs
Reads the percentage of CPU that has been utilized from the registry and returns
the following load values:
n
0, if CPU utilization is greater than 90 percent
n
1, if CPU utilization is greater than 75 percent
n
2, if CPU utlization is greater than 25 percent
n
3, if CPU utilization is less or equal to 25 percent
memoryutilisation.vbs
Calculates the percentage of memory that has been utilized and returns the
following load values:
n
0, if memory utilization is greater than 90 percent
n
1, if memory utilization is greater than 75 percent
n
2, if memory utlization is greater than 25 percent
n
3, if memory utilization is less or equal to 25 percent
NOTE Because the cpuutilisation.vbs script uses rolling average data that is sampled every five minutes,
short-term high-utilization events might not be reflected in reported load preferences. You can reduce the
sampling period to a minimum of two minutes, but performance might be affected on the RDS host. The
sampling interval is controlled by the registry entry HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.\VMware
VDM\Performance Stats\SamplingIntervalSeconds. The default is 300 seconds.
View Administration
166 VMware, Inc.