What is the maximum number of clients that a grpc-java managedchannelbuilder can handle?

感情迁移 提交于 2019-12-11 02:46:39

问题


When we create a managedChannelBuilder and use this to call a grpc-java service call, how many clients can we serve with this? Doesn't this channel be shutdown after individual service call? Say I have a REST interface which accepts REST calls from a browser and from within these REST Service methods, I am making grpc client calls to an independent grpc server. Also I can expect client connections in the range of [4000-5000] concurrently. How well can I make use of this managedChannelBuilder. Do I need just one? Or do I need to pool multiple channelbuilders?


回答1:


Generally, I'd suggest using a single ManagedChannel per endpoint when your code can be easily structured to share it. ManagedChannel multiplexes RPCs and is thread-safe, so it can handle multiple RPCs concurrently.

In rarer cases of high very high throughput, it may make sense to use more than one ManagedChannel. Eventually ManagedChannel (or, maybe Channel) should have support for doing this natively.



来源:https://stackoverflow.com/questions/43119082/what-is-the-maximum-number-of-clients-that-a-grpc-java-managedchannelbuilder-can

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!