# 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.

![](https://415484505-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LxtoAXZwwOc4XGto8vb%2F-MAPvjinigrMWI47IjoC%2F-MAPypKHr3mN5AjrRWUn%2FScreen%20Shot%202020-06-22%20at%2009.43.07.png?alt=media\&token=9da28a84-114d-4b84-8587-a41305f24921)

### [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

![](https://415484505-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LxtoAXZwwOc4XGto8vb%2F-MAQ2Tt7DE8X7R9JZbgs%2F-MAQ3imzLHNIERmdDb0x%2FScreen%20Shot%202020-06-22%20at%2010.08.53.png?alt=media\&token=9e962d56-851d-4b4f-9782-25b324a46af4)

![](https://415484505-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LxtoAXZwwOc4XGto8vb%2F-MAQ2Tt7DE8X7R9JZbgs%2F-MAQ3ZPZNaUov2gFgBzI%2FScreen%20Shot%202020-06-22%20at%2010.08.10.png?alt=media\&token=92acb72e-41c4-45d4-afda-b94ca0accbcd)

Auto scaling happens based on thresholds.

![](https://415484505-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LxtoAXZwwOc4XGto8vb%2F-MAQ3x1VgG5DXVG3PmvC%2F-MAQ46MSFGVZRNVG3Exp%2FScreen%20Shot%202020-06-22%20at%2010.10.35.png?alt=media\&token=4948ca2c-41bc-4337-9d38-c943a49cca2a)

#### 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
