Introduce HTTP/2 max-concurrent-streams settings by jrudolph · Pull Request #2146 · akka/akka-http · GitHub
Skip to content

Introduce HTTP/2 max-concurrent-streams settings - #2146

Merged
jrudolph merged 1 commit into
akka:masterfrom
jrudolph:jr/2145
Aug 16, 2018
Merged

jrudolph merged 1 commit into
akka:masterfrom
jrudolph:jr/2145

Conversation

@jrudolph

@jrudolph jrudolph commented Aug 14, 2018 •

Copy link
Copy Markdown
Contributor

Refs #2145

The idea is to change the default for the bindAndHandleAsync parallelism parameter to 0, which means "take the value from the configuration".

We then take different values for HTTP/1 and HTTP/2:

  • for HTTP/1 take pipelining-limit because that's even stronger than parallelism
  • for HTTP/2 take a new setting http2.max-concurrent-streams

@akka-ci akka-ci added validating PR that is currently being validated by Jenkins needs-attention Indicates a PR validation failure (set by CI infrastructure) and removed validating PR that is currently being validated by Jenkins labels Aug 14, 2018
@akka-ci

akka-ci commented Aug 14, 2018

Copy link
Copy Markdown

@ktoso ktoso left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch


bindAndHandle(Flow[HttpRequest].mapAsync(parallelism)(handler), interface, port, connectionContext, settings, log)
val definitiveParallelism =
if (parallelism != 0) parallelism

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

> 0?

@johanandren johanandren left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one question about HTTP/2

def withIncomingStreamLevelBufferSize(newIncomingStreamLevelBufferSize: Int): Http2ServerSettings

def getMaxConcurrentStreams: Int = maxConcurrentStreams
def withMaxConcurrentStreams(newValue: Int): Http2ServerSettings

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thought, I don't remember the exact HTTP/2 details, but, isn't there a way this should be sent to the client to inform it about how many sub streams it may use to the server?

@ktoso ktoso Aug 16, 2018 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm indeed it can be set as SETTING frame:

5.1.2 Stream Concurrency

A peer can limit the number of concurrently active streams using the SETTINGS_MAX_CONCURRENT_STREAMS parameter (see Section 6.5.2) within a SETTINGS frame. The maximum concurrent streams setting is specific to each endpoint and applies only to the peer that receives the setting. That is, clients specify the maximum number of concurrent streams the server can initiate, and servers specify the maximum number of concurrent streams the client can initiate.

I guess this is more like a default value for us for now hm... The setting we don't respect yet I guess

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct, in future we could announce and enforce this value with HTTP/2.

@jrudolph jrudolph changed the title WIP introduce HTTP/2 max-concurrent-streams settings Introduce HTTP/2 max-concurrent-streams settings Aug 16, 2018
@akka-ci akka-ci added validating PR that is currently being validated by Jenkins and removed needs-attention Indicates a PR validation failure (set by CI infrastructure) labels Aug 16, 2018
… with HTTP/2

Before it was set to 1 regardless of HTTP/1 or HTTP/2. In HTTP/2, a higher
setting makes sense per default to actually benefit from multiplexing.
@akka-ci akka-ci added tested PR that was successfully built and tested by Jenkins and removed validating PR that is currently being validated by Jenkins labels Aug 16, 2018
@akka-ci

akka-ci commented Aug 16, 2018

Copy link
Copy Markdown

Test PASSed.

@akka-ci akka-ci added validating PR that is currently being validated by Jenkins tested PR that was successfully built and tested by Jenkins and removed tested PR that was successfully built and tested by Jenkins validating PR that is currently being validated by Jenkins labels Aug 16, 2018
@akka-ci

akka-ci commented Aug 16, 2018

Copy link
Copy Markdown

Test PASSed.

@raboof

raboof commented Aug 24, 2018

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tested PR that was successfully built and tested by Jenkins

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants