# Load Balancing

If you want to:

1. Scale out your application across multiple antlets
2. Allow access to your antlet from the outside world
3. Route traffic from one antlet to another when one fails or hangs

then load balancing is perfect for you!

**Load Balancing** is a feature on antMan that lets you distribute outside traffic across a set of antlets, called **upstreams**. Each upstream typically accomplishes the same task (e.g. serve static web content, service API requests).&#x20;

{% hint style="info" %}
As each database technology has its own version of multi-node/clustering, utilize the multi-node/clustering functionality for that database rather than a load balancer.&#x20;
{% endhint %}

## Create Load Balancing Rule

Navigate to the "Load Balancing" page from the sidebar. On this page, you will see a table that will show high-level details of each load balancing rule.

![](/files/-M0KoEqVmb2ZyD_piqiH)

Click the "Create +" button, as shown below.

![](/files/-M0Oq3Hrrs5ZibOynX6R)

Fill out the form below, and click "Create Rule."&#x20;

![](/files/-M0Or7M6WD2m6qPVgDPP)

| Name         | Description                                                                                                                           |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------- |
| Server Name  | URL where you can access your upstreams. (e.g.`my-balanced-page.local`, `example.com`)                                                |
| Server Port  | Port where you can access your upstreams                                                                                              |
| Upstreams    | Applications that you are serving. These are usually copies of the same application served on different Antsle servers                |
| Backup only  | If selected, this upstream will only be used if the others are down                                                                   |
| Address      | Address of this upstream (e.g. `myserver.com`, `10.1.1.102:80`)                                                                       |
| Weight       | The amount of times the load balancer will route traffic to this upstream before moving to the next upstream in a round-robin fashion |
| Add Upstream | Add more upstreams as needed                                                                                                          |

Test your load balancer by repeatedly visiting the Server URL (e.g. `my-balanced-page.local`). As you repeatedly visit the URL, the load balancer will route the request to each of the different upstreams, taking into account the weight of each upstream.&#x20;

## Edit Load Balancing Rule

To make changes to a load balancing rule, click the "Edit" button as shown below:

![](/files/-M0Kr2tnbhotpCok1_uP)

Once confirmed, the changes will take place immediately.

## Delete Load Balancing Rule

To delete a load balancing rule, click the "Delete" button as shown below:

![](/files/-M0KqOnI-Rd7y4amm1wT)

Confirm deletion by clicking the button below that says "Yes, delete!"

![](/files/-M0KqPuMSUFmnIqBwLNw)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.antsle.com/networking/load-balancing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
