Repository navigation
Conversation
The forward transport cloned http.DefaultTransport, so when the workspace negotiated HTTP/2 every concurrent forwarded request multiplexed onto one TCP connection once a connection was warm. Parallel downloads then shared that connection's throughput. Turn HTTP/2 off for the forward transport. Each concurrent request gets its own connection, and WebSocket upgrades keep working over HTTP/1.1. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
databricks sandbox forwardturns HTTP/2 off for its upstream transport, so each concurrent forwarded request gets its own connection. WebSocket upgrades still go over HTTP/1.1.Why
The forward transport clones
http.DefaultTransport. When the workspace negotiates HTTP/2, a warm connection pool sends all concurrent forwarded requests over one TCP connection, so parallel downloads share that connection's throughput. This matches CJ-82287, where four parallel 100 MiB downloads were no faster than one.Cold starts already opened one connection per concurrent request, so the sharing only shows once a connection is warm, as it is after a first download.
Not measured yet: live throughput. Confirming the ~2x target needs a benchmark run against a sandbox.
Tests
go test ./cmd/sandbox: passes.TestForwardUsesSeparateUpstreamConnectionsfails on the old transport (the four requests used one upstream connection) and passes with this change (one warm plus three new).TestForwardHandlerRelaysUpgradeOverTLScovers WebSocket upgrade through the real transport against an HTTP/2-enabled TLS upstream.go test ./acceptance -run TestAccept/cmd/sandbox/forward: passes../task lint-q: Go reports 0 issues.This pull request and its description were written by Isaac.