NETWORKING / A CONCEPT NOTE

Load Balancers

distributing traffic across servers to keep things fast and reliable

~80 sec read

Overview · mechanism
pitfall · examples

01 / THE SHORT VERSION

The idea in a few sentences.

A load balancer sits in front of a group of servers and distributes incoming requests across them using algorithms like round-robin, least connections, or IP hash. It also runs health checks — if a server goes down, traffic stops going to it. Cloud LBs (ALB, NLB, GLB) scale transparently and terminate TLS.

02 / FOLLOW THE MECHANISM

How a load balancer routes traffic

  1. Client

    sends a request to the load balancer's DNS name or IP.

  2. Load Balancer

    terminates TLS (if HTTPS), inspects the request, and picks a target based on its algorithm.

  3. Health check

    the LB has already verified which targets are healthy via periodic HTTP or TCP checks.

  4. Target server

    receives the request, processes it, and sends the response back through the LB.

  5. Stickiness

    optional — if sessions need to persist, the LB sets a cookie to pin the client to the same target.

04 / COMMAND NOTES

Read the command, then the result.

Inspect the flags and arguments before trying an example. Snippets can need local setup, replacement values, or resources in your own environment.

EXAMPLE 01 · REFERENCE

list all target groups and health status

aws elbv2 describe-target-groups

EXAMPLE 02 · REFERENCE

inspect LB response headers

curl -I https://your-alb-dns.us-east-1.elb.amazonaws.com

Explore command anatomy in the CLI lab