Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions presto-native-execution/presto_cpp/main/common/Configs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ SystemConfig::SystemConfig() {
NUM_PROP(kHttpServerHttp2InitialReceiveWindow, 1 << 20),
NUM_PROP(kHttpServerHttp2ReceiveStreamWindowSize, 1 << 20),
NUM_PROP(kHttpServerHttp2ReceiveSessionWindowSize, 10 * (1 << 20)),
NUM_PROP(kHttpServerIdleTimeoutMs, 60'000),
STR_PROP(
kHttpsSupportedCiphers,
"ECDHE-ECDSA-AES256-GCM-SHA384,AES256-GCM-SHA384"),
Expand Down Expand Up @@ -317,6 +318,10 @@ uint32_t SystemConfig::httpServerHttp2ReceiveSessionWindowSize() const {
.value();
}

uint32_t SystemConfig::httpServerIdleTimeoutMs() const {
return optionalProperty<uint32_t>(kHttpServerIdleTimeoutMs).value();
}

std::string SystemConfig::httpsSupportedCiphers() const {
return optionalProperty(kHttpsSupportedCiphers).value();
}
Expand Down
7 changes: 7 additions & 0 deletions presto-native-execution/presto_cpp/main/common/Configs.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ class SystemConfig : public ConfigBase {
/// HTTP/2 receive session window size in bytes (default 10MB).
static constexpr std::string_view kHttpServerHttp2ReceiveSessionWindowSize{
"http-server.http2.receive-session-window-size"};

/// HTTP server idle timeout in milliseconds
static constexpr std::string_view kHttpServerIdleTimeoutMs{
"http-server.idle-timeout-ms"};

/// List of comma separated ciphers the client can use.
///
/// NOTE: the client needs to have at least one cipher shared with server
Expand Down Expand Up @@ -817,6 +822,8 @@ class SystemConfig : public ConfigBase {

uint32_t httpServerHttp2ReceiveSessionWindowSize() const;

uint32_t httpServerIdleTimeoutMs() const;

/// A list of ciphers (comma separated) that are supported by
/// server and client. Note Java and folly::SSLContext use different names to
/// refer to the same cipher. For e.g. TLS_RSA_WITH_AES_256_GCM_SHA384 in Java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ void HttpServer::start(
std::function<void(proxygen::HTTPServer* /*server*/)> onSuccess,
std::function<void(std::exception_ptr)> onError) {
proxygen::HTTPServerOptions options;
options.idleTimeout = std::chrono::milliseconds(60'000);
options.idleTimeout = std::chrono::milliseconds(
SystemConfig::instance()->httpServerIdleTimeoutMs());
options.enableContentCompression = false;

proxygen::RequestHandlerChain handlerFactories;
Expand Down
Loading