Book Contents

Book Index

Load Balancer

Book Contents

Book Index

Introduction

The Load Balancer is an element of the K2 architecture that can be used to distribute the load among multiple application servers. K2 API can thus connect to multiple application servers at the same time. When a request is sent, the least loaded server is determined first, and that server receives the request for processing.

LoadBalancer.gif

Picture: Load Balancer and K2 API

Example of using the Load Balancer and K2 API:

K2 API receives a request for processing. For the fastest processing of the request, the Load Balancer is contacted. The Load Balancer sends a request to all AS and determines their current load. It evaluates the least loaded server and passes this information to K2 API. K2 API then sends the request directly via the application server selected by the Load Balancer.

The LoadBalancer can also be used for Web K2, which finds the most suitable application server when a user logs in and connects the user to it.

LoadBalancer1.gif

Picture: Load Balancer and Web K2

Example of using the Load Balancer and Web K2:

Web K2 receives a user login request. To process the request as quickly as possible, Web K2 contacts the Load Balancer. The Load Balancer sends a request to all AS and determines their current load. It passes the information about the least loaded server to Web K2. Web K2 uses the best-evaluated server, so the user login request is processed as quickly as possible. Every further request of the given user is then processed by the specific selected AS.

Each installation of K2 API and Web K2 has its own Load Balancer. In the installation, it is thus possible to set a specific list of application servers as well as the Load Balancer configuration, with which we can influence the algorithm for selecting a suitable application server.

The Load Balancer evaluates the most suitable application server for processing a request in two modes:

  1. Loading and evaluating the best AS before each connection request (preLoadingEnabled=false)
    • Before each request to create a connection, the application servers are queried for their statistics, which are then processed and evaluated. The most suitable AS is then used for the given request.
  2. Loading and evaluating the best AS continuously (preLoadingEnabled=true)
    • Statistics are loaded and the best AS is evaluated at a specified time interval. Each connection request is evaluated based on the precalculated result of the statistics.

Book Contents

Book Index

Load Balancer parameters

If, in either mode, the Load Balancer does not connect to the AS within the required time interval, or the AS does not deliver statistics within the specified time, the AS is excluded from the evaluation for the given pass. In the next pass, the Load Balancer will try to connect to the given AS again.