-
Notifications
You must be signed in to change notification settings - Fork 3.4k
WIP: HTTP/2 + VirtualThreads #26896
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
base: master
Are you sure you want to change the base?
WIP: HTTP/2 + VirtualThreads #26896
Conversation
Lower number of TCP/IP connections for HTTP/2
Reviewer's guide (collapsed on small PRs)Reviewer's GuideInternal communication now defaults to HTTP/2 with adjusted connection limits and uses virtual threads for both server HTTP listeners and internal HTTP clients. Sequence diagram for HTTP client configuration with HTTP/2 and virtual threadssequenceDiagram
participant CoordinatorModule
participant InternalCommunicationConfig
participant HttpClientConfig
CoordinatorModule->>InternalCommunicationConfig: buildConfigObject()
CoordinatorModule->>HttpClientConfig: withConfigDefaults()
HttpClientConfig->>InternalCommunicationConfig: isHttp2Enabled()
alt HTTP/2 enabled
HttpClientConfig->>HttpClientConfig: setMaxConnectionsPerServer(64)
else HTTP/2 not enabled
HttpClientConfig->>HttpClientConfig: setMaxConnectionsPerServer(250)
end
HttpClientConfig->>HttpClientConfig: setHttp2Enabled()
HttpClientConfig->>HttpClientConfig: setUseVirtualThreads(true)
Class diagram for updated InternalCommunicationConfig and HttpClientConfigclassDiagram
class InternalCommunicationConfig {
- String sharedSecret
- boolean http2Enabled = true
- boolean httpsRequired
- String keyStorePath
- String keyStorePassword
}
class HttpClientConfig {
- boolean http2Enabled
- boolean useVirtualThreads
- Duration idleTimeout
- Duration requestTimeout
- int maxConnectionsPerServer
}
InternalCommunicationConfig --> HttpClientConfig : configures
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Started benchmark workflow for this PR with test type =
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `core/trino-main/src/main/java/io/trino/server/CoordinatorModule.java:365-368` </location>
<code_context>
config.setIdleTimeout(new Duration(60, SECONDS));
config.setRequestTimeout(new Duration(20, SECONDS));
- config.setMaxConnectionsPerServer(250);
+ if (internalCommunicationConfig.isHttp2Enabled()) {
+ config.setMaxConnectionsPerServer(64);
+ }
+ else {
+ config.setMaxConnectionsPerServer(250);
+ }
</code_context>
<issue_to_address>
**issue (performance):** Connection limits are now conditional on HTTP/2, which may affect scaling.
Verify that 64 connections per server is adequate for your HTTP/2 workloads, or consider making this limit configurable to better support varying traffic demands.
</issue_to_address>
### Comment 2
<location> `core/trino-main/src/test/java/io/trino/server/TestInternalCommunicationConfig.java:35` </location>
<code_context>
assertRecordedDefaults(recordDefaults(InternalCommunicationConfig.class)
.setSharedSecret(null)
- .setHttp2Enabled(false)
+ .setHttp2Enabled(true)
.setHttpsRequired(false)
.setKeyStorePath(null)
</code_context>
<issue_to_address>
**suggestion (testing):** Test for default value of http2Enabled updated to true.
Also add a test case for when http2Enabled is unset to confirm the default value is correctly applied.
</issue_to_address>
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
core/trino-main/src/test/java/io/trino/server/TestInternalCommunicationConfig.java
Show resolved
Hide resolved
Started benchmark workflow for this PR with test type =
|
Description
Additional context and related issues
Release notes
(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:
Summary by Sourcery
Enable HTTP/2 by default and activate virtual threads for internal HTTP communication and the HTTP server, adjust connection pool settings accordingly, and update tests to reflect new defaults.
New Features:
Enhancements:
Tests: