microdot icon indicating copy to clipboard operation
microdot copied to clipboard

Does it load balance?

Open srinathgnath opened this issue 6 years ago • 1 comments

Team, Do you any documentation over Load balancing? If not, could you please give a high level flow.

Thanks

srinathgnath avatar Apr 23 '18 23:04 srinathgnath

@srinathgnath Unfortunately we don't have documentation for it right now, but I'll be glad to give you a quick overview.

There are two load balancing mechanisms:

  1. Server-side load balancing done by Orleans. Orleans distributes load across the cluster using it's own methods, which you can read about here.

  2. Client-side load balancing done by Microdot for inter-service calls. Calls to other services are distributed across the various nodes of that server/cluster using a round-robin approach combined with an optional correlation-ID-based "sticky session", which means that multiple calls with the same correlation ID (a.k.a RequestID, settable via TracingContext.SetRequestID()) will always go to the same node of the target service to reduce the chances that Orleans tries attempts to create duplicate activations of the same grain in multiple hosts, which requires time to resolve. This is only a performance optimization, not a matter of correctness.

Feel free to ask more questions!

Allon-Guralnek avatar Apr 24 '18 09:04 Allon-Guralnek