If you use Apache Web Server for application proxies, I recommend that you use mod_proxy and mod_proxy_balancer . You can find a brief introduction about mod_proxy here . This is true for Jetty, but it is easily applicable to other servers.
The first thing you need to worry about clustering is a way to handle sessions. You must be sure that the request belonging to the session is directed to the same server (or the session is somehow saved and then always retrieved). Mod_proxy can do this for you.
For the load balancing algorithm, see the mod_proxy_balancer documentation. Accordingly, there are 3 load balancing scheduler algorithms.
An older load balancing solution is mod_jk.
In general, this is not something that I could implement myself, even if I had a better algorithm. Itβs better to use an existing solution.
source share