Skip to content

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

@steveluscher

Description

@steveluscher

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions