> For the complete documentation index, see [llms.txt](https://docs.glesys.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.glesys.com/products/connectivity/load-balancer/how-tos/understand-targets-weights.md).

# Understand targets' weights

***

For the examples here, we'll continue with the HTTP load balancer from [Create a HTTP load balancer](/products/connectivity/load-balancer/how-tos/create-a-http-load-balancer.md). This assumes three web servers as targets, each one serving a web page with the server name in the `<title>` tag.

If we had assigned the first server—*web1*—a weight of five, while the other two servers each had a weight of one, the first server would receive five requests while the other two would each receive one request.

We run the test script below again.

{% code title="test-lb.sh" %}

```bash
#!/bin/bash
x=1
while [ $x -le 15 ]
do
  curl -s http://203.0.113.155 | grep "<title>"
  x=$(( $x + 1 ))
done
```

{% endcode %}

Running the script will, in this example, where the first server has a weight of five, output the following (or similar to it):

{% code title="Example output" %}

```terminal
  <title>Web Server 1</title>
  <title>Web Server 1</title>
  <title>Web Server 1</title>
  <title>Web Server 1</title>
  <title>Web Server 1</title>
  <title>Web Server 1</title>
  <title>Web Server 1</title>
  <title>Web Server 1</title>
  <title>Web Server 3</title>
  <title>Web Server 1</title>
  <title>Web Server 1</title>
  <title>Web Server 3</title>
  <title>Web Server 1</title>
  <title>Web Server 1</title>
  <title>Web Server 2</title>
```

{% endcode %}

If we instead lower the weight of the first server to two, that server will receive two requests while the other servers will each receive one. A new test confirms this to be correct:

{% code title="Example output" %}

```terminal
  <title>Web Server 1</title>
  <title>Web Server 1</title>
  <title>Web Server 3</title>
  <title>Web Server 3</title>
  <title>Web Server 1</title>
  <title>Web Server 2</title>
  <title>Web Server 1</title>
  <title>Web Server 1</title>
  <title>Web Server 1</title>
  <title>Web Server 3</title>
  <title>Web Server 1</title>
  <title>Web Server 2</title>
  <title>Web Server 2</title>
  <title>Web Server 3</title>
  <title>Web Server 1</title> 
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.glesys.com/products/connectivity/load-balancer/how-tos/understand-targets-weights.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.
