Skip to content
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

[native] Add reserved memory capacity configs #22593

Merged
merged 1 commit into from Apr 30, 2024

Conversation

xiaoxmeng
Copy link
Contributor

@xiaoxmeng xiaoxmeng commented Apr 24, 2024

Add two system configs for reserved query memory capacity:
query-reserved-memory-gb: the total amount of query memory capacity reserved to ensure that a
query has minimal memory capacity to run
memory-pool-reserved-capacity: the minimal amount of memory capacity in bytes reserved for
each query memory pool.

@xiaoxmeng xiaoxmeng requested a review from a team as a code owner April 24, 2024 07:36
@xiaoxmeng xiaoxmeng changed the title [native] Add memory arbitrator reserved capacity configs [native] Add reserved memory capacity configs Apr 24, 2024
tanjialiang
tanjialiang previously approved these changes Apr 24, 2024
Copy link
Contributor

@tanjialiang tanjialiang left a comment

Choose a reason for hiding this comment

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

Thanks, %nits

presto-native-execution/presto_cpp/main/common/Configs.cpp Outdated Show resolved Hide resolved
tanjialiang
tanjialiang previously approved these changes Apr 24, 2024
shrinidhijoshi
shrinidhijoshi previously approved these changes Apr 27, 2024
NikhilCollooru
NikhilCollooru previously approved these changes Apr 27, 2024
tanjialiang
tanjialiang previously approved these changes Apr 28, 2024
@@ -462,12 +463,22 @@ int32_t SystemConfig::queryMemoryGb() const {
return optionalProperty<int32_t>(kQueryMemoryGb).value();
}

int32_t SystemConfig::queryReservedMemoryGb() const {
Copy link
Contributor

Choose a reason for hiding this comment

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

uint32_t ?

Copy link
Contributor

@aditi-pandit aditi-pandit left a comment

Choose a reason for hiding this comment

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

@xiaoxmeng :
Thanks for your code changes.

Would be great to have some examples for these configs. Do we have Velox docs for them already ? Please can you add Prestissimo documentation for them.

@@ -462,12 +463,22 @@ int32_t SystemConfig::queryMemoryGb() const {
return optionalProperty<int32_t>(kQueryMemoryGb).value();
}

int32_t SystemConfig::queryReservedMemoryGb() const {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this 32 bit vs 64 bit usage in other places ? Might be good to keep it uniform.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is just to be the same type as queryMemoryGb. We could uniform these config settings in followup. Thanks!

@@ -256,6 +256,17 @@ class SystemConfig : public ConfigBase {
/// this config only applies if the memory arbitration has been enabled.
static constexpr std::string_view kQueryMemoryGb{"query-memory-gb"};

/// Specifies the amount of query memory capacity reserved to ensure that a
Copy link
Contributor

Choose a reason for hiding this comment

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

How would you typically determine this value ? Whats a good back of the envelope calculation for this ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It can be based on the number of concurrent running queries * reserved memory pool capacity.

@@ -256,6 +256,17 @@ class SystemConfig : public ConfigBase {
/// this config only applies if the memory arbitration has been enabled.
static constexpr std::string_view kQueryMemoryGb{"query-memory-gb"};

/// Specifies the amount of query memory capacity reserved to ensure that a
/// query has minimal memory capacity to run. This capacity should be less
/// than 'query-memory-gb'. A query's minimal memory capacity is specified by
Copy link
Contributor

Choose a reason for hiding this comment

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

The relation between 'query-reserved-memory-gb' and 'memory-pool-reserved-capacity' is a bit difficult to follow. Can you elaborate ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@xiaoxmeng xiaoxmeng force-pushed the config branch 2 times, most recently from e181dde to fd89c5e Compare April 30, 2024 04:32
@xiaoxmeng
Copy link
Contributor Author

int32_t

We have velox documentation for these configs.

Add two system configs for reserved query memory capacity:
query-reserved-memory-gb: the total amount of query memory capacity reserved to ensure that a
query has minimal memory capacity to run
memory-pool-reserved-capacity: the minimal amount of memory capacity in bytes reserved for
each query memory pool.
Copy link
Contributor

@tanjialiang tanjialiang left a comment

Choose a reason for hiding this comment

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

Thanks

@xiaoxmeng xiaoxmeng merged commit 775ef4d into prestodb:master Apr 30, 2024
59 checks passed
@xiaoxmeng xiaoxmeng deleted the config branch May 9, 2024 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants