Types of Layer 7 load balancing
To carry out more precise load balancing, the content switch has to be able to look into the payload of the packet. The main decision-making parameters are described below:
- URL Parsing
- This involves looking at the URL that appears just after the HTTP GET header, and sending the request to one of a group of servers based on that address.
- HTTP Header interrogation
- Your content switches can glean a lot of information by looking at the header information.
- The User-Agent
- Header tells the content switch what type of browser your client has, so you can point them at a format that will suit theirs best.
- Cookies
A special case of header information, the cookies sent down from your servers to clients, either temporarily for the duration of that session, or permanently, to be stored on the users’ hard drives, give you more information to make routing decisions on.
This is known as persistence. Persistent load balancing can be achieved using IP address or the use of cookies - the latter being the more flexible. The problem here is that if you’re running secure HTTP (on an e-commerce site) the cookie is within the encrypted SSL payload, so the content server can’t see it to action it.
One option here is to offload SSL onto a dedicated device connected to the content switch - an SSL processing engine within the switch itself. It has the benefit for the servers that it removes all the SSL processing impact, thus freeing up the servers to concentrate on serving data.
Before a client issues a GET request, there is a TCP handshake process between the client and server. If the load balancing decision is to be made based on HTTP header information, the switch will have to proxy that process, negotiate with the client, find out what information it needs, decide on the best server, and then carry out a handshake with the server, pretending it’s the client. All while keeping TCP sequence numbers in order on both sides.
This is known as delayed binding, and is a prerequisite to Layer 7 load balancing.
If this transaction doesn’t require persistence, they may well not be, so the switch will have to bring up a TCP session to every new server it sends traffic to, while tearing down connections that are no longer required.
All of which adds to a fair bit of processing. And explains why Layer 7 load balancers are more powerful, more complex - and more expensive – than those that use purely addressing information to make their decisions.
Advantages of Layer 7 load balancing
- Better server efficiency
- High powered server experience
Because different types of content have different requirements in terms of CPU usage, I/O throughput etc, you can get better efficiencies out of your servers by grouping them so that some handle transactions, while others just act as massive storage systems for serving up static pages, or are optimised for downloading streaming video, for instance.
Layer 7 also allows for some users to be directed at higher-powered servers, if they are premium customers, or are on your site to place an order rather than just browse.


