-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
good practice for gateway peer loadbalancing #257
Comments
These pieces of gRPC documentation may be relevant: Definitely we should have some documentation on deployment patterns and best-practices with Fabric Gateway. Where appropriate we should reference existing documentation (like those gRPC ones above) instead of duplicating or recreating that information. |
load balancing will not guarantee the initial endorse will be balanced as gateway decides based on block height which peer to use but does favour the gateway peer. under load the gateway information on block height could be stale |
On the Kubernetes front there are a few different approaches that we can employ to shape traffic between the gateway client and peers. All of these will provide some level of HA, failover, and traffic distribution across a set of peers. Gateway load balancing within Kubernetes can be accomplished by establishing a One downside of using the Kubernetes Service routing is that any finer-grain message routing, e.g. at the gRPC message layer, is not possible. Kubernetes can help with the initial assignment of a TCP connection to one of the backing peers, but once a client connection is established it will be maintained for the duration of the socket. By default a Kubernetes Service will use Building on the iptables routing, it looks like a Kube service can also use
rr: round-robin In addition, the IPVS routing mode includes a Building on the Kubernetes defaults, we could consider an additional layer of traffic shaping by co-deploying a Fabric network within a service mesh, as provided by Ambassador, Istio, or Linkerd. This approach may be a little more involved and not generally applicable to all environments running a Fabric network on K8s. In addition to finding a home on the Fabric docs site, I like the idea of including a reference deployment within the Kubernetes test network. Do we have a reference example app showing the best practices for authoring a Fabric application using the Gateway SDK? (e.g. fabric-rest-sample, but using the Gateway SDK) |
@jkneubuh I can create a PR on the (see hyperledger/fabric-samples#532) I believe there is an example planned for the gateway, meanwhile I'll refer you to the LedgerMessaging IBM example. |
@bestbeforetoday I believe we've done all we can at the moment. |
I still have a draft PR (lingering) open for the peer load balancing in k8s. It's got some good info but is still too "kube specific" in the context where it's currently anchored in the docs. Mark please leave this one open. I will connect with Josh (H) on finding the correct page / site for the doc content. |
Another potentially useful snippet of information on how to configure client-side load balancing over a set of IP addresses using the Node gRPC client: A key piece of information is that grpc-js now supports https://github.com/grpc/grpc/blob/master/doc/naming.md This should probably be included in a sample somewhere, or at least just in the API docs. |
Best-practice recommendations for production deployment, which discusses load balancing / fail-over, is published in the full-stack-asset-transfer-guide sample. |
We should provide guidance on this as part of samples/documentation some considerations are
Please feel free to add more thoughts, info for capturing plus where appropriate artifacts demonstrating this should be created
The text was updated successfully, but these errors were encountered: