In computing, load balancing refers to the process of distributing a set of tasks over a set of resources (computing units), with the aim of making their overall processing more efficient. A load balancer is a hardware or software solution that helps to move packets efficiently across multiple servers, optimizes the use of network resources, and prevents network overloads.
For a content delivery service, Load balancing is the process of distributing the network traffic across multiple servers in a cluster or server pool to ensure that no single server becomes overload and unreliable.
In MerlinCDN distributions, end-user requests are redirected to the origin on below occasions:
- On the first request of the content through MerlinCDN
- If a content is updated on the Origin
- If a content is set as no-cache
MerlinCDN provides load balancing between the end-user devices and MerlinCDN servers. You can specify the load balancing between MerlinCDN and your origin servers on MerlinCDN Management panel through Weight setting for Origin server IP addresses and load balancing types available on Origin settings.
If you have multiple origins, configure load balancing so that MerlinCDN can route requests across the servers in your Origin cluster as opposed to being directed to a single server.
Load Balancer types available in MerlinCDN
Round Robin
It is the most common and widely deployed load balancing algorithm. Requests are routed to each server one by one on a rotational basis. Round Robin algorithm does not consider server load, system resources, or active connections on the servers in balancing. It is most useful when servers are of equal specification as load balancing with Round Robin algorithm distributes requests evenly to all available servers.
Example
You have three servers: Server 1, Server 2, Server 3
Server 1, Server 2, Server 3 are defined as Origin servers for a MerlinCDN distribution.
If Round Robin is selected as Load Balancing type, MerlinCDN routes the requests in the following order:
- The first request is sent to Server 1.
- The second request is sent to Server 2.
- The third request is sent to Server 3.
Round Robin balancing is the recommended option if the servers are identical or similar enough to handle equal loads. Round Robin algorithm does not have a way to route more requests to servers with idle capacity in a logical manner. As a result, servers with less capacity may overload or saturate quickly. If certain servers have more CPU, RAM, or other specifications that enable them to handle more load, it is recommended to configure Weight settings according to each servers’ capacity.
Least Connection
Requests are routed to the server with the fewest active connections. This type of load balancing lowers the risk of server overload by preventing new connections to a server that already has more persistent connections compared with the other ones in the same server pool. Least Connections load balancing does not consider system resources such as CPU and RAM on the servers, however, it ensures always loading the servers that are more likely to handle new connections the best by redirecting new requests to the server with the least connections. If the servers are not identical, the least connection type might result in loading servers with less capacity while capacity lies idle on the ones with higher CPU or system resources.
Example
You have three servers: Server 1, Server 2, Server 3
Server 1, Server 2, Server 3 are defined as Origin servers for a MerlinCDN distribution.
- Server 1 can handle upto 10 units of concurrent connections
- Server 2 can handle upto 30 units of concurrent connections
- Server 3 can handle upto 50 units of concurrent connections
- Server 1 has 8 units of active connections
- Server 2 has 15 units of active connections
- Server 3 has 30 units of active connections
If least connection is selected as Load Balancing type, MerlinCDN will route a request to Server 1. This will load the server almost to its max limit while Server 3 has 20 units of connection capacity unutilized.
Sticky Session
Session stickiness, also known as session persistence, is a process in which a load balancer creates an affinity between a client and a specific network server for the duration of a session. Many web sites have the need to serve personalized user data over the course of a session. Session stickiness provides an efficient, accurate way to maintain session information between an end-user and server and can help reduce network workload.
For each request from the same client, requests are routed to the same server each time, where session data is stored and updated until the session expires or terminated.
Random
No certain rules are executed in redirecting requests to origin servers.
Comments
Please sign in to leave a comment.