Introduction to load balancing
Load balancing lets you distribute incoming network traffic across multiple servers so that no one server takes on all the demand. This allows high traffic sites and applications to field a large number of users without performance degradation. It also lets you scale a site or application by adding more servers as your need grows, or remove them if your need diminishes.
Linode offers load balancers as a service (LBaaS) called NodeBalancers. NodeBalancers are built for high availability and designed to be maintenance free after initial configuration.
This guide provides a high-level overview of NodeBalancers. To set-up a NodeBalancer, see the Getting started with NodeBalancers guide.
Overview
A NodeBalancer is assigned its own public IP address where it will listen for incoming connections. Then, using configurable rules, it routes the connection to one back-end node (out of one or more). A NodeBalancer allows the incoming traffic load to your application to be spread over any number of Linodes.
A non-load balanced configuration
In a standard non-load balanced configuration, traffic comes into a server directly. The application or site might be connected to a database or other services, but the server takes care of all traffic. If the traffic becomes unmanageable, load times may become long and the site may even go down. Additionally, any modifications that require updating DNS will inflict downtime for the user.
A simple load balanced configuration
When using a load balancer, like a NodeBalancer, traffic comes to the site through the load balancer first. It's then managed before reaching the Linode. In addition to balancing traffic load, NodeBalancers also offer features like SSL termination. NodeBalancers alleviate this burden from the server allowing them to be faster at other tasks, like serving pages. Therefore, even with only one server on the back end, having a NodeBalancer in front of your server can be an advantage.
A highly available load balanced configuration
The optimal solution for a highly available site or application is to have multiple Linodes behind a NodeBalancer. Now when traffic comes into the NodeBalancer it can be routed to any one of the Linodes available.
- Health checks are performed to make sure that requests are only routed to healthy Linodes.
- Back-end Linodes can be added or removed seamlessly without end users noticing any downtime.
- Client requests can be routed to the same back-end Linode through sticky sessions.
- Linode Cloud Firewalls provides enhanced security by allowing you to control who can access your NodeBalancer. The optional Cloud Firewalls sits between your NodeBalancer and the internet to filter out unwanted network traffic before it reaches your NodeBalancer. When used in conjunction with NodeBalancers, a Cloud Firewall’s inbound rules only apply to the NodeBalancer’s public IP, not the IPs of the back-end nodes. This means you may also want to add individual back-end nodes to a Cloud Firewalls to protect any additional exposed IP addresses.
Configuring NodeBalancers
Updated 2 months ago