Labs / Under Load / TCP performance, QoS, MTU & load balancing

Lab 4 of 4 · TCP performance, QoS, MTU & load balancing

Load balancing: one address, many servers

Put three servers behind one address, then crash one and drain another.

Open this lab Pro 6 steps

The idea

A laptop asks frontDoor, one address in front of three web servers, webA, webB and webC. The load balancer picks a server for each request and stops sending to the dead.

Turns ignore how busy a server is
Turns ignore how busy a server is
Two connections either way
Two connections either way

Steps

  1. One address, three servers

    One server can only take so many users, so busy sites put several behind one address. frontDoor, 10.0.1.10, is a load balancer in front of three web servers, its backends. Each one answers with its name. Send six requests to the one address.

    laptop:~# curl -s --max-time 3 'http://10.0.1.10:80/#[1-6]'
  2. Round robin vs least connections

    Taking turns is fair only while every server is as fast as the others. webB is now slow. Send 30 overlapping requests to Port 80 (round robin), then to port 8081, which picks the one with the fewest open connections.

    laptop:~# h2load --h1 -n 30 -c 30 -r 1 --rate-period 50ms http://10.0.1.10:80/
    laptop:~# h2load --h1 -n 30 -c 30 -r 1 --rate-period 50ms http://10.0.1.10:8081/

Pro

4 more steps in the app

  1. Two connections, or one passed through
  2. Health checks
  3. Running, but not healthy
  4. Draining a server for maintenance
Get Pro

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Start with a free account: Google or email, no card.

Open this lab