Skip past navigation linksSecure Global Desktop 4.40 Administration Guide > SGD Servers, Arrays, and Load Balancing > Configuring Application Load Balancing

Configuring Application Load Balancing

The purpose of application load balancing is to select the application server that gives the user the best performance for a particular application. When launching an application, SGD builds a list of candidate application servers using the application servers listed on the Hosting Application Servers tab for the application object. SGD then has to determine which of the candidates is the best one for the user. The decision takes into account the following factors:

This page describes how these factors and your SGD configuration affect the choice of application server.

Application Server Availability

When launching an application, SGD 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 deselecting the Application Start check box on the General tab for the application server object in the SGD Administration Console. You can do this, for example, to make an application server unavailable during maintenance work.

If you are using SGD Advanced Load Management, the load balancing service sends regular keep alive packets to SGD. If these packets stop, SGD considers the application server to be 'out of contact' and treats the server as unavailable until the load balancing service makes contact again.

Load Balancing Groups

Load balancing groups are used to group SGD servers and application servers together. When a user runs an application, SGD tries to ensure that the Protocol Engine runs on an SGD server in the same group as the application server. This works best when all the application servers and SGD servers in a group are connected by high-speed links.

See Load Balancing Groups for more detail.

Server Affinity

When launching applications, SGD 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, SGD launches 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 application servers.

Server affinity is expressed as a percentage. Currently only the following two values are allowed:

You change the server affinity value by running the following command:

Skip past command syntax or program code$ tarantella config edit --tarantella-config-applaunch-appserveraffinity affinity_value

Note If you are using Windows applications, it is best not to change this value, as using multiple application servers causes problems, especially with roaming profiles. There might also be licensing implications for running different applications in a suite of applications on different servers.

The Relative Power of the Application Servers

SGD allows you to factor in the relative power of the application servers 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 or decrease these weightings to increase or decrease the likelihood of SGD choosing an application server. You can use this to perform the following:

For more details on how the weighting is used, see the load calculations in the following sections.

Example 1

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.

Example 2

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.

The Application Server With the Least Load

SGD supports several methods for selecting the application server with the least load.

You set a default method on the Global Settings » Performance tab in the SGD Administration Console. You can override the default by specifying a different method on the Performance tab for the application object. This allows you load balance applications in different ways.

The following are the supported application load balancing methods:

The Least CPU Usage and Most Free Memory methods calculate the true load of the application server when a user launches an application. This is called Advanced Load Management. To use Advanced Load Management, the Sun Secure Global Desktop Enhancement Module must be installed and running on every application server. The Sun Secure Global Desktop Enhancement Module contains a load balancing service which provides SGD with real-time information about the application server's CPU and memory load. It also helps SGD to detect whether an application server is available, for example because it is being rebooted.

Note You can only load balance Windows, X and character applications with Advanced Load Management.

Fewest Application Sessions

The Fewest Application Sessions method allows SGD 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 hosted through SGD.

This method is the default.

If you use Advanced Load Management, the Fewest Application Sessions method 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 SGD server is being restarted.

The application server load is calculated using the following formula:

Skip past command syntax or program codenumber of application sessions x 100 /server weighting

Example Calculation

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:

Skip past command syntax or program code10 x 100/100 = 10

The load value for paris is:

Skip past command syntax or program code12 x 100/100 = 12

Assuming the other conditions for launching an application are met, SGD chooses london to launch the next two application sessions. If the server weighting value for london was decreased to 50, SGD chooses paris to launch the next 8 application sessions, because london's load is now 20 (10 x 100/50).

Least CPU Usage

The Least CPU Usage method allows SGD to choose the application server with the most CPU idle and is suitable for applications that require many processor cycles.

The method 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:

Skip past command syntax or program code(BogoMips x CPU idle %) x weighting /100

Example Calculation

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:

Skip past command syntax or program code(500 x 25) x 75/100 = 9375

The spare capacity for paris is:

Skip past command syntax or program code(100 x 50) x 100/100 = 5000

Assuming the other conditions for launching an application are met, london is chosen as the application server, even though paris is using less of its CPU and has a higher server weighting value.

Most Free Memory

The Most Free Memory method allows SGD to choose the application server with most free virtual memory and is suitable for applications that require a lot of memory.

The method 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:

Skip past command syntax or program codevirtual memory free x weighting /100

Example Calculation

The application server london has a server weighting value of 100 and has 250 megabytes virtual memory free.

The application server paris has a server weighting value of 75 and has 500 megabytes virtual memory free.

The spare capacity value for london is:

Skip past command syntax or program code250 x 100/100 = 250

The spare capacity value for paris is:

Skip past command syntax or program code500 x 75/100 = 375

Assuming the other conditions for launching an application are met, paris is the chosen application server.

Related Topics