# ELB

## ELB (Elastic Load Balancer)

Evenly distributes incoming web traffic across multiple EC2 instances in multiple availability zones.

* This increases fault tolerance of apps
* ELB detects unhealthy instances and routes traffic only to healthy instances.

![](/files/-MAPypKHr3mN5AjrRWUn)

### [Pricing](https://aws.amazon.com/elasticloadbalancing/pricing/)

**Free tier is NOT** available for ELB.

* How are you charged for using ELB
  * each hour or partial hour the load balancer is running
  * for each GB of data transferred through the load balancer

## Auto Scaling

A tool that can automate scale-in and scale-out of EC2 instances based on traffic demands.

* scaling **in and out** => adds and removes instances
* scaling **up and down** => adds additional resources like memory/disk to existing instances

#### Autoscaling groups

![](/files/-MAQ3imzLHNIERmdDb0x)

![](/files/-MAQ3ZPZNaUov2gFgBzI)

Auto scaling happens based on thresholds.

![](/files/-MAQ46MSFGVZRNVG3Exp)

#### Autoscaling components

* Launch configuration
  * EC2 template used when auto scaling needs to add an additional server to auto scaling group
* Auto scaling group
  * all the rules and settings that govern when EC2 server is automatically added or removed

### Pricing

Auto scaling is free to use.But you will be charged for resources that Auto Scaling provision (e.g. EC2 instances that go beyond Free Tier allotment)

#### How to create

* create launch configuration
* create auto scaling group using launch configuration


---

# 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://amartyushov.gitbook.io/tech/platforms/aws/elb.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.
