Application performance monitoring tools and metrics quiz How data from APM tools helps businesses improve CX
X

Application vs. network load balancing: What's the difference?

Network load balancing and application load balancing both handle traffic requests. However, they process and direct requests with different levels of speed and efficiency.

None of the services users take for granted on the internet -- such as online shopping, reading the news or checking investments -- or in large corporate IT environments would work without load balancing.

Load balancing spreads traffic over multiple systems that might be geographically distributed in clouds or data centers and located in virtual servers or dedicated systems worldwide. For example, without load balancing, everyone who checked a news website or shopped online would access the same system. If all that traffic flowed into any single system, the servers would become hopelessly bogged down. Load balancing directs that traffic among servers so they share the load more evenly.

Two common types of load balancing are network load balancing and application load balancing. Each differs by whether it operates at Layer 4 or Layer 7 of the seven-layer OSI model.

What is network load balancing?

Network load balancing is implemented in a system or device that operates similarly to a router, often with hardware and software designed specifically for the purpose. It operates at Layer 4, the transport layer, and supports protocols such as TCP and User Datagram Protocol (UDP). TCP guarantees all packets are delivered, while UDP makes no guarantees.

End users make requests to services using commonly known domain names. For example, a request to CNN's website goes to the load balancer identified by the site's internet address. The load balancer's routing table is configured with multiple IP addresses of systems loaded with CNN content. The balancer performs a quick operation, forwarding the request to the appropriate system.

A network load balancer doesn't examine the request's content, so it doesn't decide where to direct the request based on the content. If a server goes offline, a load balancer skips the route to it, providing overall reliability.

What is application load balancing?

Application load balancing operates at Layer 7, the application layer. An application installed on a server examines each incoming request, such as HTTPS or SMTP requests. Application load balancing can direct requests toward one of the servers best able to satisfy the request. For example, an online shopping request could be directed to a system maintaining the inventory for that type of product.

While a network load balancer forwards requests, application load balancing examines the application layer protocol data from the request header. This examination takes more time than network load balancing, but it enables the balancer to make a more informed decision about where to direct the request.

Comparison diagram of network load balancing vs. application load balancing.
Compare the differences between network load balancing and application load balancing.

Load-balancing algorithms

As requests arrive, load balancers use different algorithms to choose possible routes. Some algorithms are static, meaning they route requests according to predefined rules, while others are dynamic and make routing adjustments based on factors such as server workloads and response times. Examples of commonly used load-balancing algorithms include the following:

  • Round robin. This simple type of static algorithm evenly cycles through possible server destinations.
  • Weighted round robin. This static variant enables network administrators to designate routing weights to different servers based on each system's capacity. As a result, it's suited to IT environments in which the servers don't all have uniform processing capabilities.
  • IP hash. This static algorithm hashes client IP addresses to send requests from the same IP addresses to specific servers on an ongoing basis. This supports session persistence, which can be useful in stateful applications.
  • Least connection. In any load-balancing scenario, each server maintains a queue of requests with various active client connections. This dynamic load-balancing algorithm, also sometimes referred to as least outstanding request, selects servers with the fewest number of connections or queued requests on the premise that they can deliver the quickest response. While efficient, the approach requires an extra communication step: Servers must send a message to the load balancer whenever a connection is terminated or a request is removed from the queue.
  • Weighted least connection. Like the weighted round-robin method, this dynamic algorithm assigns weights to servers based on the number of active connections they can handle. However, load balancing is still done dynamically based on the number of connections there are at any given time.
  • Least response time. This dynamic algorithm determines which server responds most quickly and routes requests accordingly. Sometimes called fastest response, this method can be combined with the least connection method by adding an average time measurement that tracks the rate at which different servers close connections and remove requests from their queue.
  • Resource-based. This dynamic load-balancing algorithm queries software agents installed on servers to track the use of compute and memory resources. It then routes requests to servers based on resource availability.

Differences in speed and efficiency

Network load balancing and application load balancing each have advantages, depending on the type of internet service required. Network, or Layer 4, load balancers can provide faster responses, as they forward requests without examining them. Application, or Layer 7, load balancers offer greater overall efficiency because they send requests where they are most efficiently handled.

The choice of network or application load balancing depends on the type of information stored in web applications, cloud environments and on-premises systems, as well as the reason people access it and the level of traffic.

Using CNN again as an example, users typically go to its website for the latest news. Some click on a specific story, while others see what's on the homepage and select a story from there. Application load balancing wouldn't be useful in the latter scenario because the requests are simply to CNN.com and don't include information on the individual stories users will choose. The required routing of requests to different servers for performance optimization is a task for a network load balancer.

On the other hand, requests to Amazon's website by online shoppers often involve a particular type of product. Application load balancing would be useful in this case. Directing an initial request to a server that supports the product type a shopper is interested in should help speed up the response.

Network and application load-balancing tools

A wide variety of load balancers are available to buy or for free. Some offer just application or network load balancing, while others support both types. The following are some examples of popular commercial products, listed in alphabetical order:

  • Akamai NodeBalancers.
  • Azure Load Balancer (Microsoft).
  • Barracuda Load Balancer ADC.
  • Cloudflare Load Balancing.
  • Cloud Load Balancing (Google).
  • DigitalOcean Load Balancers.
  • Elastic Load Balancing (AWS).
  • F5 Big-IP, Nginx One and Distributed Cloud DNS Load Balancer.
  • Fastly Load Balancer.
  • Netscaler ADC.
  • Progress Kemp LoadMaster.
  • VMware Avi Load Balancer.

Open source load-balancing tools with free editions include HAProxy, Relianoid and Traefik Proxy. Some commercial products, such as Progress Kemp LoadMaster, also include a free version, while others can be used free for evaluation or a limited time.

David Jacobs has more than 30 years of networking industry experience. He has managed leading-edge hardware and software development projects as well as consulted Fortune 500 companies and software startups.

Next Steps

Benefits of APM for businesses

APM vs. observability: Key differences explained

APM vs. distributed tracing: How they differ

APM best practices: Strategies to adopt

Application performance monitoring vs. management

Dig Deeper on Network infrastructure