Nirvana Load Balancing Server

Introduction

The Nirvana Load Balancing Server is an example of an embedded server and is designed to provide a lightweight intermediary server that will control which realm a client is directed to within a cluster of realms (or a collection of unclustered realms). Nirvana provides a method of clustering realm servers so that clients can transparently connect to any of the cluster realms and get the same information from resources. The load balancing server can be used to provide a round-robin approach to redirecting clients to one of the cluster realms so that the client connection load is shared equally among all realms.

Running a load balancing server

The load balancing server is provided as a sample server application within the Nirvana install. When you run the loadbalancing server application, it will automatically bind to the default interface and port specified in the install procedure (default is nsp://0.0.0.0:9000).

To run the loadbalancing server, open up a server command prompt (i.e. for windows the Start->Nirvana>Server->ServerName->Command Prompt option.

The load balancing server requires the RNAME values for those servers that the clients connecting to it will be redirected to. If there is a cluster, then the load balancing server will automatically work out the RNAME values and the realms to use during redirection based on just one RNAME of a realm cluster member. For example, if i have a cluster of realms accessed with the following RNAME values:

nsp://myhost:9000/
nsp://myhost:9004/
nsp://myhost:9008/

and my loadbalancing server is running on the same host using port 80, running the following from the server command prompt:

nloadbalanceserver nsp://localhost:9000/

will enable the load balance server to connect to the realm on port 9000 from which it will discover the cluster and the realms that are part of the cluster. These 3 realms will then be used in the round-robin approach to redirecting clients.

Alternatively, if the above realms were not part of a cluster but you wanted to use them to balance your client load, you could simply provide a list of the RNAMEs, for example, by running the following:

nloadbalanceserver nsp://localhost:9000/ nsp://localhost:9004/ nsp://localhost:9008/

which will ensure all 3 realms are used by the load balancing server.