Setting Up Load Balancing Rules

Load balancing is a way to distribute communications more evenly across multiple systems.  When you access a web site, for instance, you are accessing one specific address.  Behind that address, however, are many machines to handle the traffic.  The job of the load balancer is to seamlessly distribute this traffic within the pool of virtual machines so that access is transparent.  

This can be demonstrated by the following picture.

Load Balancing

Datapipe's Stratosphere EPN provides for three different methods of load balancing:

  • Round Robin --> Each new session request is passed off to the next server in the pool, in the order received.
  • Least Load -->  Each new session request is passed off to the server in the pool with the least load.
  • Source -->  Each session from a different source is passed off to the next server in the pool.  Sessions from the same source remain on the same server.

To determine if you have a load balancer rule, from the browser option for you "IP Addresses", select the "Load Balancing" tab,

Load Balancer

If you have any load balancing rules, they will be displayed in your browser.  If not, you can create a new rule by clicking on the "New Load Balancer Rule" tab.  This will bring up a popup such as below:

Load Balancer 1

Every rule must have a name so give your rule a meaningful or memorable name.  A public port then needs to be mapped to a private port.  The ports do not have to match.  Eg., web traffic typically uses TCP port 80 so you could use that for the public port and map it to port 8080 for the private port.

Note:TCP port 8081 is reserved for HAproxy.  If you try to use that port, it may cause your load balancer to hang in an "Add" state.  Rules added or modified thereafter will be not able to proceed.

When all the boxes are completed to your satisfaction, click on the "Create Load Balancer Rule" button.  This will return you to your browser view where you will see the rule you just created.  To begin to add virtual machines to your load balancer, click on the "Virtual Machines" button on the far right.

Load Balancer 3

Note: Once a load balancing rule has been created, it cannot be changed.  If you need to change the rule, delete and recreate it by clicking on the 'X' at the far right of your browser view.

The next step is to register virtual machines with your load balancer by selecting from the list of available machines as shown below..

Load Balancer 4

You can add one machine at a time or you can hold your shift key down and select a group of machines at once. When you are satisfied with your selection, click on the "Add Virtual Machine(s)" button.  Once the procedure is completed, your popup will be refreshed and the machines you added will be displayed.

Load Balancer 5

From here, you can continue to add more machines by repeating the above steps.  If you have a machine that you do not want to be included in load balancing, you can delete it by clicking on the Terminatebutton after its entry.

You can have multiple load balancing rules for different ports and/or different virtual machines. Web sites often support regular HTTP traffic (port 80) as well as secure traffic (port 443). If you need to load balance both, you will need to create two rules to do this.

Best practice is to not create contradictory rules such as having different rules using the same ports. Eg., rule 1 has port 80 mapped to port 8080 on the private network; rule 2 has port 443 also mapped to port 8080 on the private network. This could produce unexpected results.

Note: You should only load balance virtual machines that are functionally identical. If, for example, you load balance web servers that have different default pages, you will get different results at different times as focus shifts from one instance to another.

Best practice is to load balance virtual machines that have similar service offerings. It would reasonable to load balance several nano-h-10 instances, for example. It would be problematic to load balance a nano-h-10 with a kilo-1-40. Although it is not impossible to mix and match widely diverse systems within a load balancing array, doing so could lead to erratic and unpredictable results.