-
Start the loadbalancer by running the file
lb.pypython3 lb.py
-
Start the backend servers by running the file
be.pypython3 be.py <port>
-
You can start multiple instances of the server by running it on different ports
-
Make a request to the loadbalancer
lb.pycontains the loadbalancer that runs a TCPServer and forwards the requests to the list of healthy serversbe.pycontains a demo backend server that again starts a TCPServer at the specified port and responds to requests with a generic messagehealth.pycontains the health check loop that checks the health of the available servers every x secondsstrategyContains theServerSelectionStrategybase class to choose the next server from the list of availabe ones
