What is load balancing? Learn how health checks and Layer 4 and Layer 7 routing distribute traffic and when a site can withstand spikes or server failures.
👉 Master your Security+ skills with Pluralsight here: Pluralsight
You’ll learn what load balancing is, how health checks and Layer 4 and Layer 7 routing guide traffic, and how to tell whether a website can stay online during traffic spikes or server failures.
Chapters: 0:00 Intro 0:12 What is load balancing, and why does it matter? 0:53 How does a load balancer choose a server? 1:49 What’s the difference between Layer 4 and Layer 7 load balancing? 2:44 What can still go wrong with load balancing? 3:45 Outro
Affiliate notice: Some links may earn a commission. Thanks for your support.
Key Takeaways
Load balancing is an availability control: It distributes incoming work across eligible servers to avoid overloading any one server. Redundancy provides backup resources; autoscaling adds or removes capacity as demand changes.
Routing rules choose the pool, health checks determine eligibility, and a balancing algorithm picks the server. A server can pass a port check even when the application can’t process requests.
Layer 4 routes by connection details; Layer 7 routes by application details such as HTTP paths. DNS steering returns an endpoint address rather than forwarding traffic, so cached answers can delay failover. See Microsoft’s load-balancing overview.
Equal request counts don’t mean equal workloads. Round robin takes turns, weighted routing gives higher-capacity servers a larger share, and least connections uses active connections as a rough measure of load.
Test whether surviving capacity can meet demand. A load balancer can redirect new requests after a failure, but it can’t add capacity or move requests already in progress. Check whether the frontend and shared dependencies, such as the database, can also withstand failures.
👉 Try Pluralsight to apply what you’ve learned in guided security labs, get feedback, and check your Security+ readiness with practice exams.
Load balancing distributes incoming work across multiple resources that can handle it. An online store might have one web address and three checkout servers behind it. Instead of sending every request to the same server, a load balancer decides where each new request or connection should go.
The goal isn’t always an even split. It’s to use available capacity without overloading individual servers and to keep the service reachable when a server fails. For CompTIA Security+, that makes load balancing an availability control: it helps keep systems usable when people need them.
Load Balancing vs. Redundancy and Autoscaling
These concepts work together, but they solve different problems:
FAQ
Quick answers to the questions people usually ask about this topic.
What’s the difference between a load balancer and a reverse proxy?
A reverse proxy accepts requests on behalf of backend servers and forwards them. Load balancing is the job of choosing which eligible backend receives the work. A Layer 7 load balancer often does both, but a reverse proxy can also forward requests to a single backend without balancing anything.
Which load balancing algorithm works best when requests take different amounts of time?
Least connections can be a better starting point than round robin when connections have very different lifetimes, because it accounts for how many are still active. But one connection can carry several requests, and some requests are more expensive than others. Compare backend latency, errors, and resource usage under representative traffic before settling on an algorithm.
Why can one backend server be overloaded while the others are idle?
An even request count doesn’t guarantee an even workload. One server may get more expensive requests, or sticky sessions and IP-based hashing may concentrate traffic on a single backend. Compare per-server request volume, latency, and resource usage to tell whether the problem is uneven routing or uneven work.
What does a 503 error from a load balancer mean?
If the load balancer generated the 503, one possible cause is that the selected backend pool has no eligible targets. The application can also return a 503 that the balancer passes through. Identify which component generated the response, then check the listener’s routing rule, the selected pool, and its health-check results.
How do I choose between a regional load balancer and global traffic steering?
Use regional load balancing to distribute work among backends within one region. Add global traffic steering when you need to choose among regional endpoints for latency or failover. If you steer traffic with DNS, cached answers can delay the move, and existing connections won’t transfer automatically. Microsoft’s load-balancing overview compares options by scope and network layer.
How can I practice applying load balancing and availability concepts for CompTIA Security+?
Start with a checkout scenario: trace how a request reaches a backend, then predict what happens if a server fails or the remaining servers run out of capacity. For more hands-on security practice, try Pluralsight for guided labs and feedback, plus assessments and practice exams that can help you decide what to study next.
Some links may earn a commission. Thanks for your support.
Watch in the video playerOpen the dedicated player for this course.
Concept
What it does
Redundancy
Provides alternate resources, such as extra application servers.
Load balancing
Directs incoming work to eligible resources.
Autoscaling
Adds or removes capacity as demand changes.
High availability
Describes the design goal of keeping a service usable through disruptions.
A load balancer can distribute a traffic spike across the servers you already have. It cannot create more capacity if those servers are already at their limit.
How a Load Balancer Routes a Request
Suppose a customer visits /checkout on an online store. Here’s how the request reaches a server:
The request reaches the frontend. The store’s hostname resolves to the load balancer’s frontend address. A listener accepts HTTPS traffic on port 443. One logical frontend can be backed by multiple load balancer nodes, so one public address doesn’t necessarily mean one device.
A routing rule chooses a backend pool. A Layer 7 rule might send /checkout to the checkout pool and /catalog to the catalog pool. A backend pool, also called a target group, is the set of servers or application instances that can handle that traffic.
Health checks determine which servers are eligible. A TCP check can confirm that a port accepts connections. An HTTP readiness check can look for an expected response from an application endpoint such as /ready. Neither proves that checkout works unless the check actually reflects what checkout needs.
A balancing algorithm picks a server. If servers A, B, and C are healthy, round robin might send consecutive requests to A, B, C, then A again. Once B is marked unhealthy, new requests normally go to A and C. A request already running on B can still fail; it doesn’t automatically move to another server.
The distinction is useful when troubleshooting: a routing rule selects the pool, a health check determines which targets are eligible, and a balancing algorithm picks a target.
Layer 4 vs. Layer 7 vs. DNS Load Balancing
Approach
What it looks at
Example and limitation
Layer 4 load balancing
Connection or flow details such as IP addresses, ports, and transport protocol.
Distributes TCP file-transfer connections or UDP game traffic. It doesn’t read HTTP paths such as /checkout.
Layer 7 load balancing
Application details such as HTTP hostnames, paths, headers, or cookies.
Sends /checkout and /catalog to different pools. To read an HTTPS path, the balancer must be able to decrypt the request.
DNS-based traffic steering
Selects which endpoint address to return, potentially based on health, latency, geography, or weight.
Points clients to another region during an outage. DNS doesn’t forward application traffic, and cached answers can delay the shift. Existing connections don’t move when a DNS answer changes.
These approaches can work together. DNS might choose a region, a Layer 7 load balancer in that region might route requests to the checkout pool, and an internal Layer 4 balancer might distribute connections to a private service. Microsoft’s load-balancing overview compares these approaches by layer and scope.
Common Load Balancing Algorithms
Algorithm
How it chooses a target
What to watch for
Round robin
Takes turns across eligible servers.
Equal request counts don’t mean equal work. Generating a sales report can take much more effort than serving a small page.
Weighted round robin
Gives higher-weight servers a larger share of traffic.
Useful when servers have different capacities, but a fixed weight doesn’t show how busy a server is right now.
Least connections
Favors the server with the fewest active connections.
One connection can carry multiple requests, so connection count is an imperfect measure of workload.
Hash-based selection
Uses a key, such as a client IP address, to select a server.
An IP-based hash can send many users to the same server if they share a public IP address.
A related policy, session affinity (also called sticky sessions), tries to send the same user back to the same server. It can help an application that stores shopping carts in server memory, but it won’t recover a cart if that server crashes. If the application uses a shared session store, another server can pick up the session, provided the store is still available.
Will a Website Stay Online During a Traffic Spike or Server Failure?
Start by comparing incoming demand with surviving capacity. Suppose three servers can each sustain 100 requests per second and the site receives 240. With all three available, that’s about 80 requests per second per server if traffic is split evenly. If one fails, the two remaining servers can handle only 200 requests per second combined. The load balancer can redirect traffic, but it can’t make up the 40-request-per-second shortfall. Overload can then spread to the surviving servers.
Capacity is only one part of the assessment. When you look at a system diagram, check these failure points too:
The frontend: If the only load balancer fails, can clients still reach the service? Healthy backend servers don’t help if there’s no working path to them.
Load balancing can support disaster recovery by directing traffic to a standby region and helping restore service within the recovery time objective (RTO). It doesn’t determine how much data might be lost. That’s the recovery point objective (RPO), which depends on how data is protected and recovered.
What Load Balancing Does Not Protect Against
Load balancing supports availability, but it isn’t a substitute for other security controls. A load balancer may terminate TLS, but encryption between the balancer and the backend is a separate configuration decision. A web application firewall (WAF) may be integrated with the frontend, but it’s the WAF that filters requests. And distributing traffic alone won’t stop a DDoS attack that exhausts upstream bandwidth or shared capacity.
Practice These Concepts for Security+
Once you can trace a request from the frontend to a backend server, put that understanding to work. Pluralsight offers guided security labs and feedback, plus assessments and practice exams to help you identify what to study next.
Shared dependencies: Can the remaining servers still reach the database and session store? Three healthy web servers can’t finish checkout if they all depend on the same unavailable database.
Health checks: Do they detect an application that accepts connections but can’t process orders? Check what the balancer does if all targets are marked unhealthy, because behavior varies by product.
In-flight work: During planned maintenance, connection draining stops assigning new work to a server and gives existing work time to finish. A crash offers no such grace period.
Monitoring: Compare healthy-target counts, request volume, latency, and errors. Distinguishing errors generated by the balancer from errors returned by the application helps narrow down where the failure is occurring.
Affiliate link — I may earn a commission at no additional cost to you.
Jay's Recommendation
Turn understanding into hands-on confidence
You've built the foundations. Pluralsight adds opportunities to practice in guided security labs, get feedback, and check your knowledge with assessments and practice exams, so your next step is more than another video.
đź› Put concepts to workBuild practical skills with guided security labs and feedback.
🎯Find your weak spotsUse assessments to focus on what needs more work.
📝Check your understandingUse practice exams to guide your certification preparation.
đź§Give study sessions directionOrganize further learning with curated paths and progress tracking.