How Does Layer 7 Load Balancing Work?

This post explains what is meant by layer 7 load balancing and an example of content switching using HTTP URL parsing is given later in the post. In the OSI model layer 7 is the applications layer and there are a number of application protocoals that are used this layer:

  • Hypertext Transport Protocol (HTTP) for web pages
  • File Transport Protocol (FTP) for file transfer
  • Real Time Streaming Protocol (RTSP) for streaming media such as video

A load balancing switch can be used at layer 7 to load balance in a number of different ways. These include:

  • HTTP header Inspection
  • HTTP URL Parsing
  • RTSP Parsing

One of the main reasons why layer 7 load balancing is used is that our company will want to ensure that differ web applications run on servers that are configured and set up to maximise the efficiency of those servers and also to minimise the cost in acquiring and running the servers.

Suppose that we are a web hosting company like Hostgator or Bluehost and we need to host many different types of website. These would include websites with just static pages, online shops with backend transaction processing, and even websites like youtube that are dedicated to providing video streaming to the world. If we did not load balance the incoming requests from the web based on content type (or application type) then we would have to make sure that all of the servers we use were of the same technical specification and capable of handling our most complex applications. This would be expensive and our finanical director would have constant headaches while us techies could gloat to our friends about all the massive servers we had. Our friends in turn would have data center envy :-). They would then give their financial director a headache from the constant requests to get bigger servers so they could gloat at us - and so on.

In reality what we would do is something like the following. First we would decide that we needed three different types of server, one for each application type:

  • a low spec server configured to run static websites
  • a higher spec server configured to run the online shops
  • an even higher spec server configured for video streaming

Then we would place a content switch in front of the three different types of servers/applications. And we would configure the content switch to send the different types of request to the different types of servers. Easy really!

HTTP URL Parsing

Lets say that on our smaller servers we only run static websites that consit mainly of html web pages and gig or jpeg images. On our medium sized servers we run complex shopping sites that use applications servers and datbase servers and so on. These are more dynamic websites and need to handle a high volume of transactions day and night (24/7).

Our content switch will need to insect incoming requests and make sure to send them to the right set of servers. It can do this by looking at the file extensions in the url. Extensions like html, gif and jpeg can go to the static website servers and the more complex (such as ASP or Java) can go to the dynamic servers.

{ 0 comments… add one now }

There are no comments yet...

Kick things off by filling out the form below ↓

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>