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

Use UniformStreamByteDistributor for HTTP/2 connections #1523

Merged

Conversation

idelpivnitskiy
Copy link
Member

Motivation:

HTTP/2 spec defines priorities for streams. However, in ST we do not
expose API to assign priorities for streams and this features is rarely
used in general. Http2FrameCodecBuilder creates connections with
WeightedFairQueueByteDistributor by default that takes priorities into
account. We can use UniformStreamByteDistributor to reduce overhead of
managing HTTP/2 streams.

Modifications:

  • Extend Http2FrameCodecBuilder to use UniformStreamByteDistributor
    for new Http2Connection(s);

Result:

Less CPU usage for HTTP/2 ~1-1.5% according to the benchmarks.

Motivation:

HTTP/2 spec defines priorities for streams. However, in ST we do not
expose API to assign priorities for streams and this features is rarely
used in general. `Http2FrameCodecBuilder` creates connections with
`WeightedFairQueueByteDistributor` by default that takes priorities into
account. We can use `UniformStreamByteDistributor` to reduce overhead of
managing HTTP/2 streams.

Modifications:

- Extend `Http2FrameCodecBuilder` to use `UniformStreamByteDistributor`
for new `Http2Connection`(s);

Result:

Less CPU usage for HTTP/2 ~1-1.5% according to the benchmarks.
@idelpivnitskiy idelpivnitskiy force-pushed the UniformStreamByteDistributor branch from 3a27000 to 5eb5e1e Compare May 11, 2021 01:11
@idelpivnitskiy idelpivnitskiy force-pushed the UniformStreamByteDistributor branch from 5eb5e1e to aa21c37 Compare May 11, 2021 01:11
@idelpivnitskiy idelpivnitskiy marked this pull request as ready for review May 20, 2021 06:50
@idelpivnitskiy idelpivnitskiy merged commit 3a20890 into apple:main May 20, 2021
@idelpivnitskiy idelpivnitskiy deleted the UniformStreamByteDistributor branch May 20, 2021 20:42
hbelmiro pushed a commit to hbelmiro/servicetalk that referenced this pull request May 23, 2021
Motivation:

HTTP/2 spec defines priorities for streams. However, in ST we do not
expose API to assign priorities for streams and this feature is rarely
used in general. `Http2FrameCodecBuilder` creates connections with
`WeightedFairQueueByteDistributor` by default that takes priorities into
account. We can use `UniformStreamByteDistributor` to reduce overhead of
managing HTTP/2 streams.

Modifications:

- Extend `Http2FrameCodecBuilder` to use `UniformStreamByteDistributor`
for new `Http2Connection`(s);

Result:

Less CPU usage for HTTP/2 ~1-1.5% according to the benchmarks.
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

Successfully merging this pull request may close these issues.

2 participants