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

Implement the HTTP/2 protocol to increase the number of concurrent requests #673

Open
steveluscher opened this issue Jun 7, 2022 · 1 comment

Comments

@steveluscher
Copy link

Background

I work on a system that offers an API over JSON RPC using this library. A couple of folks were advocating for advanced batching in our client library. Turns out what they were trying to solve was fundamentally a performance problem. This is when I discovered that our RPC nodes are running in HTTP/1.1 mode.

Problem

Because the RPC operates in HTTP/1.1 mode it's unable to pipeline more than 6 requests at a time.

image

When you make more than 6 RPC requests in parallel, the browser produces this nightmare of a waterfall, where each request has to wait on a CORS preflight in batches of 6, and then resolve the data in batches of 6. This imposes a massive delay on getting your answer, and is making our apps many times slower and less responsive than they could be.

image

If you put a proxy in front of paritytech/jsonrpc that supports HTTP/3 it yields parallel request resolution like this.

image

Playground: https://codesandbox.io/s/sweet-surf-qu60i3?file=/src/index.js

Proposed Solution

  • Implement HTTP/2 or HTTP/3 in this library.
@linuskendall
Copy link

Particularly relevant for CLI tools - browsers will follow whatever the proxy/frontend provides in terms of hints but on the CLI Node seems to always use HTTP/1.1 unless HTTP/2 is specifically implemented.

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