Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When running the runtime in a clustered configuration, load balancing is required in order to distribute the load and assure high availability.

Servers can be added (they just also need to be added to the load balancer). Servers can only be shut down when all requests to that server have been completed. How to achieve this depends on the load balancer.

A specific load balancer is not imposed, but nginx is used as an example.

...

Nginx supports one of the following load-balancing methods, please check the workings to see which one is best for your situation (preferably based on utilization):

1. Round-robin : requests to the application servers are distributed in order across the list of servers.. This is the default behavior used by nginx.

...

Code Block
upstream myapp2 {
	server 192.168.1.1 weight=3;
	server 192.168.1.2;
	server 192.168.1.3;
}

...


2. Least-connected load-balancing — next request is assigned to the server with the least number of active connections.

...

Code Block
languagexml
titleLeast connected
http { 
	upstream myapp1 {
        least_conn;
        server 192.168.1.1;
        server 192.168.1.2;
        server 192.168.1.3;
    }
 }

...


3. ip-hash — a hash-function is used to determine what server should be selected for the next request (based on the client’s IP address). This method is similar to the sticky session mechanism.

...

backup : marks the server as a backup server. It will be passed requests when the primary servers are unavailable. 


proxy_next_upstream : Specifies in which cases a request should be passed to the next server. More specifically, this directive defines the events which are considered unsuccessful attempts of communication with a server.

...