Select a Load Balancer Policy

Load Balancing provides automated traffic distribution from one entry point to multiple servers. A load balancer improves resource utilization, facilitates scaling, and helps ensure high availability. Oracle Application Container Cloud Service supports two primary policy types:

  • Round Robin. Distributes incoming traffic sequentially to each server in a backend set list. After each server has received a connection, the load balancer repeats the list in the same order. Round Robin s the default load balancer policy.

  • IP Hash. Uses an incoming request's source IP address as a hashing key to route non-sticky traffic to the same backend server. The load balancer routes requests from the same client to the same backend server as long as that server is available. IP Hash ensures that requests from a particular client are always directed to the same backend server, as long as it is available.

Note:

The load balancing policy is set during the creating of the application and it can’t be updated after the application is created.

To specify the load balancing policy in your application set the loadBalancingPolicy parameter in the manifest.json file. The loadBalancingPolicy parameter accepts two values: ROUND_ROBIN and IP_HASH.

Example 2-4 Round Robin Load Balancing Policy

{
  "runtime": {
      "majorVersion": "8"
  },
  "command": "java -jar myapp.jar",
  "loadBalancingPolicy" : "ROUND_ROBIN"
}

Example 2-5 IP Hash Load Balancing Policy

{
  "runtime": {
      "majorVersion": "8"
  },
  "command": "java -jar myapp.jar",
  "loadBalancingPolicy" : "IP_HASH"
}