liveBook · Manning

Load balancing

As explained in Amazon Web Services in Action, Third Edition: An in-depth guide to AWS

Load balancing is the distribution of requests or workloads across multiple computing resources to improve availability and performance.

Load balancing sends incoming requests to one of several computing resources instead of relying on a single server. For a web application, a browser contacts the load balancer, which forwards the request to a web server and returns that server’s response. This gives clients one entry point while allowing the servers behind it to change. section 14.1

A load balancer also helps keep an application available when a server fails. It checks server health and routes requests only to healthy targets. Placing multiple web servers in different data centers provides protection that a single virtual machine cannot provide. section 1.2.3 section 2.2.2

For an AWS web application, the main pieces are:

  • An internet-facing load balancer with an automatically generated DNS name that clients can use. section 2.2.2
  • A target group containing the virtual machines eligible to receive requests. Check each target’s health status in the EC2 Management Console. section 2.2.2
  • A load balancer type suited to the traffic: Application Load Balancer for HTTP or HTTPS; Network Load Balancer for other scenarios. Classic Load Balancer is treated as deprecated. section 14.1

A WordPress blog

A WordPress setup uses a load balancer in front of two virtual-machine web servers, alongside a MySQL database and network filesystem. In the EC2 Management Console, select the load balancer, then open Target Groups to inspect the two servers and their health. For production monitoring, watch traffic patterns and HTTP error metrics; sudden changes can signal a problem. section 2.2 section 2.2.2

Exposing only the load balancer also avoids making clients depend on one server’s public IP address. DNS alone is less dependable for quickly redirecting clients because resolvers may cache old addresses longer than requested. Load balancers are billed as running resources, so include them when estimating costs. section 14.1 section 1.4

How Amazon Web Services in Action, Third Edition: An in-depth guide to AWS covers it

How deep it goes
Explains request forwarding, health checks, target groups, console inspection, and load balancer selection without detailing routing algorithms.
Examples
Uses a WordPress deployment with two web servers and a web shop that continues serving customers after a virtual-machine failure.
What it assumes
Assumes familiarity with autoscaling for the fuller decoupling treatment, while explaining basic HTTP request routing through EC2 web servers.
What you can do after
Operate/configure it through AWS Elastic Load Balancing by inspecting a load balancer, its target group, target health, and monitoring metrics.
How it connects
Connects load balancing to high availability, synchronous decoupling, DNS caching, EC2, and autoscaling.

Also explained in

Compare how 14 books explain load balancing →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Amazon Web Services in Action, Third Edition: An in-depth guide to AWS. The section links point to the parts of the book it draws on.