Skip to content
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

grpc@grpc-js connections pool documents #1899

Closed
lwmxiaobei opened this issue Sep 13, 2021 · 4 comments
Closed

grpc@grpc-js connections pool documents #1899

lwmxiaobei opened this issue Sep 13, 2021 · 4 comments

Comments

@lwmxiaobei
Copy link

hi, I want to know how many connections grpc@grpc-js will open by default, whether there is a concept of connection pool, or where there are related documents to read

@murgatroid99
Copy link
Member

gRPC does not use connection pools, as the term is commonly used. gRPC establishes a single connection to each backend, and sends all requests along that single connection. Some names may resolve to more than one backend (e.g. a DNS name may have both A and AAAA records, or multiple records of either kind), which may result in connections being established either to only one of those backends or to all of them, depending on the load balancing policy in use.

Open connections are reused if a different client connects to the same server, which is connection pooling in a different sense.

@lwmxiaobei
Copy link
Author

Thanks!

@matthiasgeihs
Copy link

@murgatroid99 How does your comment go in line with the following?

Each gRPC channel uses 0 or more HTTP/2 connections

https://grpc.io/docs/guides/performance/

Are you saying actually it is more like between 0 and 1 HTTP/2 connections?

@murgatroid99
Copy link
Member

I said

Some names may resolve to more than one backend (e.g. a DNS name may have both A and AAAA records, or multiple records of either kind), which may result in connections being established either to only one of those backends or to all of them, depending on the load balancing policy in use.

If the client establishes connections to more than one backend, then it will use more than one connection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants