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

Separate cpu-bound (query-execution) and IO-bound(heartbeat) to … #1883

Merged
merged 6 commits into from
Mar 1, 2022

Conversation

Ted-Jiang
Copy link
Member

@Ted-Jiang Ted-Jiang commented Feb 25, 2022

…diff tokio runtime in ballista_executor

Closes #1770.

Rationale for this change

Have tested in my local
one scheduler + one executor

Use Separate runtime
Query 1 iteration 0 took 887.1 ms 
Query 1 iteration 1 took 970.3 ms 
Query 1 iteration 2 took 874.4 ms 
Query 1 avg time: 910.59 ms

Master
Query 1 iteration 0 took 1001.6 ms
Query 1 iteration 1 took 964.2 ms
Query 1 iteration 2 took 864.9 ms
Query 1 avg time: 943.57 ms


 RUST_LOG=INFO cargo run --bin tpch -- benchmark  ballista --path xxxx/tpch-1g-oneFile  --format parquet --host localhost --port 50050 --query 1

What changes are included in this PR?

No

Are there any user-facing changes?

@Ted-Jiang
Copy link
Member Author

Ted-Jiang commented Feb 25, 2022

PTAL @alamb @houqp @yahoNanJing @liukun4515

@Ted-Jiang
Copy link
Member Author

retest this please

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

I feel strange reviewing / approving this PR (as I wrote a bunch of the code originally) but its use makes sense to me (obviously :) ).

@houqp or @thinkharderdev or @realno do you have any additional comments or thoughts on the approach?

ballista/rust/executor/src/executor_server.rs Show resolved Hide resolved
}

/// signals shutdown of this executor and any Clones
#[allow(dead_code)]
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this #allow is really necessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

For fix clippy, In the future if realized close the executor, will delete this.

/// The worker thread priority is set to low so that such tasks do
/// not starve other more important tasks (such as answering health checks)
///
pub fn new(thread_name: impl Into<String>, num_threads: usize) -> Self {
Copy link
Contributor

Choose a reason for hiding this comment

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

FWIW I think @Darksonn and others have noted that a tokio Handle might also be able to be used here https://docs.rs/tokio/1.17.0/tokio/runtime/struct.Handle.html

Copy link
Contributor

@thinkharderdev thinkharderdev left a comment

Choose a reason for hiding this comment

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

One small comment. But overall seems reasonable.

@@ -261,6 +262,8 @@ impl<T: 'static + AsLogicalPlan, U: 'static + AsExecutionPlan> TaskRunnerPool<T,
let executor_server = self.executor_server.clone();
tokio::spawn(async move {
info!("Starting the task runner pool");
//TODO make it configurable
let dedicated_executor = DedicatedExecutor::new("task_runner", 4);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should default to the number of available CPU cores.

Copy link
Member Author

Choose a reason for hiding this comment

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

set default to 4 due to: in ballista conf concurrent_tasks set 4 . We will make it configurable

Co-authored-by: Andrew Lamb <[email protected]>
@Ted-Jiang
Copy link
Member Author

retest this plz.

@Ted-Jiang Ted-Jiang closed this Mar 1, 2022
@Ted-Jiang Ted-Jiang reopened this Mar 1, 2022
@alamb
Copy link
Contributor

alamb commented Mar 1, 2022

I'll merge this one in to keep things going and we can adjust the default number of cores as follow on work

@alamb alamb merged commit 1d2a154 into apache:master Mar 1, 2022
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.

Separate cpu-bound and IO-bound work in ballista-executor by using diff tokio runtime.
4 participants