How does load balancing work

How to make a standing one-armed row | Back workout

I can't figure out how a load balancer works. For example, let's say Rackspace cloud servers.

  1. You have an instance with all of your things
  2. Are you cloning this instance so that there are really two identical copies of it?
  3. Then you get a static IP from the load balancer that goes to one of the two instances (which are really the same).

Is that right? Where can I find out more about it?

1
  • It sounds like you're wondering how distributed services work, not how load balancing works.

This depends on your setup. However, the basic setup for load balancing involves a single database server. In the Django book, the chapter on Deploying Django has a simple diagram that illustrates a basic configuration for load balancing.

Basically, all computers that create websites use the same database, which is stored on a dedicated server. Media files (such as CSS and images) can be stored on the same server or on a separate dedicated media server, although this role may be performed by the load balancer itself.

In advanced setups with very high traffic or static content, you may want to host static files on multiple different media servers. After all, you might want to set up a distributed database, but this creates a whole new class of problems and that's really a different topic (e.g. you can have a distributed database without using a load balancer).

The load balancer distributes the load between the two existing instances. Therefore, one instance doesn't do all of the work.

  1. You set up a load balancer with Rackspace.
  2. You get a static IP from the load balancer.
  3. They point the DNS of your website to the static IP of the load balancer.
  4. The load balancer redirects the traffic evenly to the two instances.

There are several implementations of load balancing, each with their own approach that offers specific advantages due to their specialization.

  1. There is usually some common or common data that links the nodes together (data, user information, etc.).
  2. This depends on the architecture of the application, whether it is stateful (storing data) or stateless (forwarding data). Typically, code-based sharing is performed between the nodes (which is basically "cloned" between the nodes).
  3. IP assignments are usually not managed through a load balancer, but the IP configurations are usually an important part of the configuration (since each networked component / device needs its own IP address).

In order to understand the specifics of an implementation, the implementation itself must be identified.