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
19 changes: 17 additions & 2 deletions presto-native-execution/presto_cpp/main/common/Configs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ SystemConfig::SystemConfig() {
NONE_PROP(kSpillerSpillPath),
NUM_PROP(kShutdownOnsetSec, 10),
NUM_PROP(kSystemMemoryGb, 40),
STR_PROP(kSystemMemPushbackEnabled, "false"),
NUM_PROP(kSystemMemLimitGb, 55),
NUM_PROP(kSystemMemShrinkGb, 8),
STR_PROP(kAsyncDataCacheEnabled, "true"),
NUM_PROP(kAsyncCacheSsdGb, 0),
NUM_PROP(kAsyncCacheSsdCheckpointGb, 0),
Expand Down Expand Up @@ -333,8 +336,20 @@ int32_t SystemConfig::shutdownOnsetSec() const {
return optionalProperty<int32_t>(kShutdownOnsetSec).value();
}

int32_t SystemConfig::systemMemoryGb() const {
return optionalProperty<int32_t>(kSystemMemoryGb).value();
uint32_t SystemConfig::systemMemoryGb() const {
return optionalProperty<uint32_t>(kSystemMemoryGb).value();
}

uint32_t SystemConfig::systemMemLimitGb() const {
return optionalProperty<uint32_t>(kSystemMemLimitGb).value();
}

uint32_t SystemConfig::systemMemShrinkGb() const {
return optionalProperty<uint32_t>(kSystemMemShrinkGb).value();
}

bool SystemConfig::systemMemPushbackEnabled() const {
return optionalProperty<bool>(kSystemMemPushbackEnabled).value();
}

uint64_t SystemConfig::asyncCacheSsdGb() const {
Expand Down
22 changes: 21 additions & 1 deletion presto-native-execution/presto_cpp/main/common/Configs.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,20 @@ class SystemConfig : public ConfigBase {
/// NOTE: the query memory capacity is enforced by memory arbitrator so that
/// this config only applies if the memory arbitration has been enabled.
static constexpr std::string_view kQueryMemoryGb{"query-memory-gb"};

/// If true, enable memory pushback when the server is under low memory
/// condition.
static constexpr std::string_view kSystemMemPushbackEnabled{
"system-mem-pushback-enabled"};
/// Specifies the system memory limit and triggers memory pushback if the
/// server memory usage exceeds this limit. This only applies if
/// 'system-mem-pushback-enabled' is true.
static constexpr std::string_view kSystemMemLimitGb{"system-mem-limit-gb"};
/// Specifies the memory to shrink when memory pushback is triggered to help
/// get the server out of low memory condition. This only applies if
/// 'system-mem-pushback-enabled' is true.
static constexpr std::string_view kSystemMemShrinkGb{"system-mem-shrink-gb"};

static constexpr std::string_view kAsyncDataCacheEnabled{
"async-data-cache-enabled"};
static constexpr std::string_view kAsyncCacheSsdGb{"async-cache-ssd-gb"};
Expand Down Expand Up @@ -433,7 +447,13 @@ class SystemConfig : public ConfigBase {

int32_t shutdownOnsetSec() const;

int32_t systemMemoryGb() const;
uint32_t systemMemoryGb() const;

bool systemMemPushbackEnabled() const;

uint32_t systemMemLimitGb() const;

uint32_t systemMemShrinkGb() const;

bool asyncDataCacheEnabled() const;

Expand Down