-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Improve configuration and resource use of MemoryManager
and DiskManager
#1668
Conversation
@@ -1057,6 +1062,42 @@ impl ExecutionConfig { | |||
self.runtime = config; | |||
self | |||
} | |||
|
|||
/// Use an an existing [MemoryManager] |
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.
Here is the new public API
Ok(()) | ||
|
||
#[tokio::test] | ||
#[should_panic(expected = "invalid max_memory. Expected greater than 0, got 0")] |
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.
previously such config errors would panic
datafusion/src/execution/context.rs
Outdated
|
||
let ctx2 = ExecutionContext::with_config(config); | ||
|
||
assert!(std::ptr::eq(Arc::as_ptr(&memory_manager), Arc::as_ptr(&ctx1.runtime_env().memory_manager))); |
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.
Here is the tests for the primary usecase we have in IOx -- sharing DiskManager
and MemoryManager
s across plans
dfbd077
to
87c541a
Compare
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.
Great config design! I really like the introduced enum configs.
Thanks @yjshen -- I think since this basically only affects you and I for the time being I will update this PR and merge it in |
Which issue does this PR close?
Resolves #1636
Rationale for this change
Creation of an
RuntimeEnv
creates a temporary directory, even when it is not used. This is unecessary per-query overheadAlso, since there is no way to share
MemoryManger
andDiskManager
s acrossRuntimeEnv's
it is not possible to get a "global" view of memory / disk use across multiple queries running concurrently.Also, certain invalid memory configuration values will panic, rather than error when set incorrectly
What changes are included in this PR?
Changes:
DiskManagerConfig
andMemoryManagerConfig
for configuring how disk and memory are managedMemoryManager
andDiskManager
rather than always creating them newAre there any user-facing changes?
Will be a change to anyone who was using the RuntimeConfig but since it was introduced recently I don't think that is very many