What is load balancing?
At a basic level, load balancing works to distribute web traffic requests among different servers to ensure high availability and optimal traffic management while avoiding overload of any one server and defending against denial of service attacks.
Load balancers increase capacity and reliability.
Generally, two types of load balancers exist: layer 7 and layer 4; layer 7 is generally used with HTTP for its efficiency. Request distribution is based on specific standard algorithms, such as round robin, weighted round robin, dynamic round robin, least connections and least response time.
In Varnish you will find three different methods (“directors”) for load balancing:
- round robin
- fallback
- random
These are all implemented in the directors-vmod.
As of Varnish 4.1 we have re-introduced the Grace mode load-balancing feature for handling requests.
You can find it here on Github.
Learn more about how Varnish can help your web performance with load balancing.