8 Comments

Kind of curious about the questions in LB section. Here is my thought

- Which algorithm is most popular?

I think maybe round robin or hash.

Round robin seems very simple to implement and maintain. If the overload of requests are normal distribution, round robin should get pretty event server loading across clusters.

Hash is quite useful if people want some requests go to the specific servers. It could achieve sticky session like functionality (same client go to same server) but with more flexibility (choose different attribute). The problem maybe is the hot key issue and distribute overload unevenly.

- We can use other attributes for hashing algorithms. For example, HTTP header, request type, client type, etc. What attributes have you used?

I think i would choose IP or specified header.

Choosing IP is because same IP means same client most of time. Then same client go to same server could benefit from local cache hit.

Choosing specified header is quite the same idea. I have set specific header and using AWS ELB target group rules to let some users go to the special target group. I can debug or control the behaviors.

Expand full comment

- Which algorithm is most popular?

Round robin is probably the most common algorithm to load balance stateless services.

The consistent hashing algorithm is used by popular services such as Discord for sticky sessions without running into scaling issues. The simple hash algorithm cannot handle dynamic changes in server instances.

- We can use other attributes for hashing algorithms. For example, HTTP header, request type, client type, etc. What attributes have you used?

Clint type (HTTP Header User-Agent) can be used to segregate mobile and desktop client traffic.

The HTTP request payload (user-id, session-id, or thing-id) can be used for routing traffic to the same service instance.

Expand full comment

Amazing! thanks a lot.

Expand full comment

Very informative article! I enjoyed reading it, thank you very much.

Expand full comment

How about geographic/proximity based load balancing?

Expand full comment