Bookmark/Search this post

Getting Started with SoftLayer Local Load Balancers

Load balancing is a way to distribute processing and communications evenly across multiple servers within a data center so that a single device does not carry the entire load. Load balancing is essential in situations where it’s difficult to predict the number of requests issued to a server. By distributing requests that would be made to a single server, you can ease the load and minimize latency.

SoftLayer load balancing enables you to employ a variety of balancing methods to distribute traffic, including persistent and non-persistent options that can be changed, activated, and deactivated at any time. For general information, refer to knowledgelayer.softlayer.com/topic/load-balancing.

In this blog, we will discuss how to use the SoftLayer API to provision, configure, and manage local load balancers.

For example, my load balancer below has two service groups, each containing two services:

1. Service group one has a virtual port of 8080 and is load balancing the traffic between two services using round robin routing method.
2. Service group two has a virtual port of 80 and is load balancing the traffic between two other services.

To retrieve the load balancer’s information, issue the getObject API using the load balancer ID and an object mask. This will return all of the service information:

Creating a SoftLayer Local Load Balancer

To create a new load balancer, you need to place an order using package 0 (additional services), and specify the item price for the load balancer you want to create.
To retrieve the list of load balancers, query package 0 using:

The object filter will sort all packages in package 0 and only return ones for the load balancer. Once you have the list of packages and know which load balancer you want to create (price_item_id), place an order specifying the location of the data center (location_id).

Congratulations! You just created your first load balancer using the API. Now, you can get the details of your new load balancer using the APIs provided above.

Configuring

To modify the configuration of the load balancer, use the SoftLayer_Network_Application_Delivery_Controller_LoadBalancer_VirtualIpAddress::editObject API. You can edit the load balancer properties by passing in a modified version of the object. In this example, you simply request the load balancer object you wish to edit, and then modify the objects in the service groups and their associated services, and pass the modified object back to the editObject API.