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

Connection pool in client side #1212

Open
venugopv opened this issue Oct 4, 2023 · 5 comments
Open

Connection pool in client side #1212

venugopv opened this issue Oct 4, 2023 · 5 comments

Comments

@venugopv
Copy link
Contributor

venugopv commented Oct 4, 2023

We're trying to set up a connection pool on the client-side but haven't found a way to do so using https://docs.rs/jsonrpsee-core/0.20.1/jsonrpsee_core/index.html.

Our setup is simple: we create a few HttpClients( using https://docs.rs/jsonrpsee-http-client/latest/jsonrpsee_http_client/struct.HttpClient.html )and then make request/batch_request calls. However, it's unclear how jsonrpsee manages HTTP connections.

I've looked into jsonrpsee's HttpClient code (at https://github.com/paritytech/jsonrpsee/blob/master/client/http-client/src/transport.rs#L170), but I couldn't find where it handles connection pooling.

It would be great if we could get some more info on connection pooling usage in jsonrpsee.

@niklasad1
Copy link
Member

Hey @venugopv

The HTTP connections are handled by the hyper "connection pool" and jsonrpsee is using the default settings.
So why do need to setup a special pool? Sure it would be great to document the jsonrpsee is using the hyper HTTP client that takes care of the connection pool..

I think it could be a good idea to document the connection pooling and maybe provide more fine-grained settings for the connection pool.

Are you running into some issues or why are you thinking about connection pooling?

@venugopv
Copy link
Contributor Author

Hi @niklasad1, thanks for your quick response. I did look into Hyper's HTTP client connection pool, but unfortunately, jsonrpsee doesn't offer a way to configure those values. It would be great if it did.

Secondly, I couldn't find an easy way to force the jsonrpsee HTTPclient[builder] to use only HTTP/2

@niklasad1
Copy link
Member

Right, are you willing to open a PR to expose those?

I would accept such change

@venugopv
Copy link
Contributor Author

venugopv commented Oct 18, 2023

@niklasad1, sure, I'm happy to do. I will consider. Just to clarify, should the pull request contain both the Hyper HTTP connection pool and HTTP/2 configuration options for jsonrpsee's HttpClient/Builder?

@niklasad1
Copy link
Member

would be nice with two different PRs but either way is fine :)

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

2 participants