chrfrenning / upgraded-umbrella

The Unlicense
1 stars 0 forks source link

Load balancer - fetch load status, counter #14

Closed alina-lapina closed 1 year ago

alina-lapina commented 1 year ago

You can decide on the design of the remote interface of the proxy server for both clients and servers on different zones.

Remote interface for clients

Proxy needs to provide a remote interface for clients so that clients can invoke its methods.

Fetch servers load once in a while (remote call)

Additionally, proxy needs access to servers’ remote interface to fetch information about servers’ load and waiting channel every once in a while. After every 18 requests that the proxy assigns to a specific server (18 replies to clients with the same server address), it will invoke a remote call to that server to fetch updated information about its workload and number of tasks in the waiting list.

Maintain counters per server

The proxy will have independent counter for each server. Hence, fetching information from each server will take place only after assigning that specific server to clients every 18 times.

Thread spec

You also have to consider that updating the proxy with servers’ workload should not interrupt servers’ or proxy’s execution mode and it should take place in another thread.

Unit tests

chrfrenning commented 1 year ago

getQueueLength now returns correct length of queue, ready for implementation on the loadbalancer @alina-lapina