What is a NodeBalancer?
How can I use a NodeBalancer? Does a NodeBalancer and a CDN do the same thing?
4 Replies
A NodeBalancer is a load balancer that is designed to work with your Linodes to remove single points of failure and add scaleability to your services.
It is not the quite the same thing as a CDN which aims connect the client to the closest server geographically or by network distance.
A NodeBalancer can be thought of as a single server, but is actually multiple servers that work together to ensure that if one goes down, another will take up its work of distributing requests to a number of Linodes that perform the same task. They are distributed across different hardware so a single server losing power will not bring the NodeBalancer down.
A typical use for a NodeBalancer would be for a large website could get more requests than one Linode alone would normally be able to handle. The customer would point their domain to the load balancer and when requests come in for the web site, the load balancer shares out the volume of requests to the available backend web servers, lets call them web1, web2, and web3.
There are different ways that the NodeBalancer can distribute the traffic.
Round Robin
The simplest way to hand of requests is to just give each backend server one request in turn. i.e. web1 gets the first request, web2 the second. When we get to the end of the list, we start another round with web1 again.
Session Stickiness
When this happens the NodeBalancer remembers each active connection and if another request comes in from the same user, it sends it back to the backend server that is working with it.
Least Connections
The NodeBalancer keeps track of how many connections are active going to each backend server and give the next request to the least busy backend server.
In this way multiple small Linodes can do the work of one large one and if one of the backend servers crashes or needs to be upgraded, it can go down while the web site remains up.
Additionally if the user knows that there are going to be a lot of requests for a special sale they are running, they can create a bunch of temporary Linodes to handle the extra traffic for a weekend and remove them afterwards saving them the cost of keeping all the extra Linodes all the time.
A NodeBalancer is not restricted to just balancing web traffic, it can provide balancing for almost any application you would want to run.
For more details, please see our guide on Getting Started with NodeBalancers our NodeBalancer Reference Guide, or our Product Page.
Hi there,
I have the problem about Nodebalancer.
If I have a Linode VPS in JP2, and I open a Nodebalancer in SG.
When JP2 is offline, the service(web/db) is still work ?
Will the VPS and Nodebalancer data be synchronized?
Thank you.
Greetings @maantw,
When configuring a NodeBalancer, the NodeBalancer is listening on a public IP address, while the backends receive that traffic via our private network within the data center. So you would not be able to configure the Node Balancer to coordinate traffic between data center locations.
You can find an example of a simple web application using our Node Balancer on our Docs page.
If interested, you can also force SSL connections.
https://www.linode.com/docs/platform/nodebalancer/nodebalancer-ssl-configuration/
Be sure to @ us on the reply, so we get pinged on your response!
If someone is interested in setting up geographic redundancy across multiple data centers, it can be done, but not with our NodeBalancers. This other Community post provides guides for configuring this: