Load Balancing 101 – Learn All About Load Balancers
Stateful vs Stateless Load Balancing
Stateful Load Balancing
A stateful load balancer is able to keep track of all current sessions using a session table. Before picking the right server to handle a request, it is able to look at a number of things using a distributed load balancing algorithm, such as the load of the different servers. Once a session is initiated and the load distribution algorithms have chosen its destination server, it sends all the upcoming packets to the server until the session comes to a close.
Stateless Load Balancing
Contrary to the process of stateful load balancing, stateless load balancing is a much simpler process. The most common method of a stateless load balancer is by making a hash of the IP address of the client down to a small number. The number is used for the balancer to decide which server to take the request. It also has the ability to pick a server entirely by random, or even go round-robin.
The hashing algorithm is the most basic form of stateless load balancing. Since one client can create a log of requests that will be sent to one server, hashing on source IP will generally not provide a good distribution. However, a combination of IP and port can create a hash value as a client creates individual requests using a different source pot.