Secure Global Desktop 4.31 Administration Guide > Arrays, servers and load balancing > Configuring application server load balancing
The purpose of application server load balancing is to select the application server (host object) that will give the user the best performance for a particular application. When launching an application, Secure Global Desktop builds a list of candidate application servers using the application servers listed on the hosts tab for the application object. Secure Global Desktop then has to determine which of the candidates is the best one for the user. The decision takes into account:
This topic describes how these factors and your Secure Global Desktop configuration affect the choice of application server.
When launching an application, Secure Global Desktop checks its list of candidate application servers to see if any of them are currently unavailable. If an application server is unavailable, it is removed from the list.
Secure Global Desktop Administrators can mark an application server as being unavailable by unchecking the Available to run applications attribute for the host object in Object Manager. You can do this, for example, to make an application server unavailable during maintenance work.
If you are using Secure Global Desktop Advanced Load Management, the load balancing service sends regular keep alive packets to Secure Global Desktop. If these packets stop, Secure Global Desktop considers the application server to be 'out of contact' and treats the server as unavailable until the load balancing service makes contact again.
Secure Global Desktop uses intelligent array routing to ensure that connections between Secure Global Desktop servers and application servers take place over high-speed links.
Secure Global Desktop's Protocol Engines convert the native protocol (such as X11), which is used between the application server and the Secure Global Desktop server, into the Adaptive Internet Protocol (AIP), which is used between the Secure Global Desktop server and the client device. AIP is optimized for lower bandwidths and, in general, it's best to use high-speed links between Secure Global Desktop servers and application servers so they're "close" in network terms.
However, if your network includes slow links, you can optimize application usability by identifying the 'location' of each array member and each application server. Intelligent array routing tries to ensure that the Protocol Engine runs on a Secure Global Desktop server in the same location as the application server. You should make sure that all servers configured with the same location are connected by high-speed links.
You define the location of each array member in Array Manager, and the location of each application server in Object Manager.
When launching applications, Secure Global Desktop takes into account whether the user is already running any applications on an application server. This is known as server affinity. Server affinity means that, if possible, Secure Global Desktop will launch an application on the same application server as the last application the user launched.
Note For server affinity to work efficiently, the applications must be associated with the same set of hosts.
Server affinity is expressed as a percentage and currently only two values are allowed:
0
- this means any running applications do not affect the
choice of application server.100
- this means any existing application servers must be
re-used if they can run the selected application. This is the default value.You change the server affinity value by running the following command:
tarantella config edit --tarantella-config-applaunch-appserveraffinity affinity_value
Note If you are using Windows applications, we recommend that you do not change this value, as using multiple application servers causes problems, especially with roaming profiles. There may also be licensing implications for running different applications in a suite of applications on different servers.
Secure Global Desktop allows you to factor the relative power of the application servers in to the decision as to where to launch an application.
The relative power is expressed as a percentage and by default all servers
have a value of 100. By editing the
weighting
load balancing property for your servers, you can
increase/decrease these weightings to increase/decrease
the likelihood of Secure Global Desktop choosing an application server.
You can use this to:
For more details on how the weighting is used, see the load calculations below.
You have two application servers london and paris, paris has a weighting of 50 and london has a weighting of 100. If all the other application launch conditions are met and the servers currently have the same load, london is more likely to be chosen to launch the application.
You have 100 application servers and you want to make just one of them "more powerful" than the others. Increase the weighting of that server to 200.
Secure Global Desktop uses a load balancing algorithm to select the application server with the least load.
You set an array-wide default algorithm on the Load Balancing Properties panel of Array Manager. You can override the default by specifying a different algorithm for the application object. This allows you load balance applications in different ways.
Currently three algorithms are supported:
To use the CPU/memory-based algorithms, the Sun Secure Global Desktop Enhancement Module must be installed and running on every application server.
Note You can only load balance Windows, X and character applications with the CPU/memory-based algorithms.
The Fewest application sessions algorithm allows Secure Global Desktop to choose the application server which is currently running the fewest number of application sessions. It is based on a simple count of the number of application sessions being hosted through Secure Global Desktop.
This algorithm is the default.
If you use either the CPU or memory-based algorithms, the Fewest application sessions algorithm is used as a fallback whenever there is a problem, for example, if the application server load information is not available to the array when the application is launched. This might happen, for example, if the primary Secure Global Desktop server is being re-started.
The application server load is calculated using the following formula:
number of application sessions x 100 /server weighting
The application server london is currently hosting 10 application sessions and has a server weighting value of 100.
The application server paris is currently hosting 12 application sessions, and has a server weighting value of 100.
The load value for london is:
10 x 100/100 = 10
The load value for paris is:
12 x 100/100 = 12
Assuming the other conditions for launching an application are met, Secure Global Desktop would chose london to launch the next two application sessions. If the server weighting value for london was decreased to 50, Secure Global Desktop would choose paris to launch the next 8 application sessions, because london's load is now 20 (10 x 100/50).
The Least CPU usage algorithm allows Secure Global Desktop to choose the application server with the most CPU idle and is suitable for applications that require many processor cycles.
The algorithm measures the application server's load in terms of its CPU capabilities (measured in bogomips) and by how much of its CPU is being used. These measurements are taken by the load balancing service.
The spare capacity is calculated using the following formula:
(bogomips x cpu idle %) x weighting /100
The application server london has a bogomips measurement of 500, a server weighting value of 75 and has 25% CPU idle.
The application server paris has a bogomips measurement of 100, a server weighting value of 100 and has 50% CPU idle.
The spare capacity for london is:
(500 x 25) x 75/100 = 9375
The spare capacity for paris is:
(100 x 50) x 100/100 = 5000
Assuming the other conditions for launching an application are met, london would be the chosen application server, even though paris is using less of its CPU and has a higher server weighting value.
The Most free memory algorithm allows Secure Global Desktop to choose the application server with most free virtual memory and is suitable for applications that require a lot of memory.
The algorithm measures the application server's load by comparing the application server's actual virtual memory with the amount of memory that is currently being used. These measurements are taken by the load balancing service.
The spare capacity is calculated using the following formula:
virtual memory free x weighting /100
The application server london has a server weighting value of 100 and has 250MB virtual memory free.
The application server paris has a server weighting value of 75 and has 500MB virtual memory free.
The spare capacity value for london is:
250 x 100/100 = 250
The spare capacity value for paris is:
500 x 75/100 = 375
Assuming the other conditions for launching an application are met, paris would be the chosen application server.
Copyright © 1997-2007 Sun Microsystems, Inc. All rights reserved.