# Configure Load Balancing

## Create a Load Balancer

{% embed url="<https://youtu.be/JaSdSVNW9bk?si=pCafm9ww-O9Low6b>" %}

{% hint style="info" %}

* Make sure before creating the load balancer in your cloud to add proper rules, ports, and network.
* When setting up a load balancer, verify that the connected server is active and operational.
  {% endhint %}

Navigate to the networking section and select the Load Balancer.

<figure><img src="https://1876135298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEC5NwtFshv6EATOemuUn%2Fuploads%2F7JGBMhHPpbsVHIX1gehs%2Fimage.png?alt=media&#x26;token=4b0ce101-f188-4674-8a84-e33961199d39" alt=""><figcaption></figcaption></figure>

## Select Network

In the network section, select the public network.

<figure><img src="https://1876135298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEC5NwtFshv6EATOemuUn%2Fuploads%2Fb8vNUH48viaBPZB0GsIE%2Fimage.png?alt=media&#x26;token=45451d4c-7394-4607-b0b7-1c99f077247e" alt=""><figcaption></figcaption></figure>

## Select Pool Members

Pool members are also known as backend servers or nodes. are the individual servers or resources that handle incoming traffic and requests behind a load balancer.

<figure><img src="https://1876135298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEC5NwtFshv6EATOemuUn%2Fuploads%2FlXLQ67W7JGNZdnbbITUI%2Fimage.png?alt=media&#x26;token=8fd04b41-1b79-4644-8c74-37a6b308f060" alt=""><figcaption></figcaption></figure>

## Set the Listener

A **listener** in load balancing is a process that checks for incoming client connections on a specific port and protocol on the load balancer. It listens for requests and routes the traffic to the appropriate pool members (backend servers) based on predefined rules and algorithms. The listener plays a crucial role in managing and directing the flow of traffic, ensuring efficient distribution and optimal resource utilization.

* **Port**: The port number on which the load balancer listens for incoming traffic.
* **Protocol**: The protocol used for communication, such as HTTP, HTTPS, TCP, or UDP.

<figure><img src="https://1876135298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEC5NwtFshv6EATOemuUn%2Fuploads%2FjxKi38axhC30mNoZc3d6%2Fimage.png?alt=media&#x26;token=799a73e0-a2e9-4dc9-933b-de294a5fe9e8" alt=""><figcaption></figcaption></figure>

## Select the Algorithm

Algorithm-> **Round Robin** -  Round Robin is a load-balancing technique that distributes incoming network traffic across a group of servers in a sequential manner. It is a simple and widely used algorithm that forwards client requests to each server in turn and then repeats the process from the beginning.  &#x20;

**Least Connections** - Least connections load balancing is a dynamic load balancing algorithm that distributes client requests to the server with the fewest active connections minimizing the chances of server overload.

**Source IP: The source** IP algorithm refers to the methods and processes used to determine the source IP address in network communications. This selection is crucial for ensuring that responses to packets reach the correct originating devices.

Select Algorithm:- Round Robin

<figure><img src="https://1876135298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEC5NwtFshv6EATOemuUn%2Fuploads%2FO9iSdoAedMfix3hrER4Q%2Fimage.png?alt=media&#x26;token=37ceccab-9dae-4436-b2a5-9712af80e8d5" alt=""><figcaption></figcaption></figure>

Set the name of the load balancer and click on Create a load balancer

<figure><img src="https://1876135298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEC5NwtFshv6EATOemuUn%2Fuploads%2F9TzCedjbtjgEIWy6Ek0Q%2Fimage.png?alt=media&#x26;token=22d0d3a0-48df-42e5-b87b-e8d61e03a742" alt=""><figcaption></figcaption></figure>

## Check the status of the Load Balancer

After creating the load balancer navigate to the load balancer and click on the overview

<figure><img src="https://1876135298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEC5NwtFshv6EATOemuUn%2Fuploads%2FOZBhaZvAqnRyWs7aT3Hm%2Fimage.png?alt=media&#x26;token=c84b02db-4fa8-4677-abdf-fb3495fd22d0" alt=""><figcaption></figcaption></figure>
