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

feat(rt): support tokio-console #730

Merged
merged 5 commits into from
Nov 11, 2022
Merged

feat(rt): support tokio-console #730

merged 5 commits into from
Nov 11, 2022

Conversation

wangrunji0408
Copy link
Member

@wangrunji0408 wangrunji0408 commented Nov 10, 2022

This PR spawns each executor as a tokio task and adds support for debugging with tokio-console.

Running with cargo r -- --tokio-console and opening tokio-console, you will have a clear view of all executors and background tasks:

risinglight-tokio-console

This will be useful in performance tuning.

This PR also upgrades dependencies and fixes issues caused by sqlparser API change.

Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Copy link
Member

@xxchan xxchan left a comment

Choose a reason for hiding this comment

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

What's the rationale of spawning a tokio task for each executor? 🤔

@wangrunji0408
Copy link
Member Author

What's the rationale of spawning a tokio task for each executor? 🤔

To make executors visible in tokio-console and allow parallel execution on a multi-thread runtime.

@xxchan
Copy link
Member

xxchan commented Nov 10, 2022

Are there any disadvantages to spawn too many tasks? 🤔 (BTW how does risingwave do it?

@skyzh
Copy link
Member

skyzh commented Nov 10, 2022

What's the rationale of spawning a tokio task for each executor? 🤔

In the future when we implement intra-operator parallelism we should spawn a tokio task for each stage instead of for each executor.

@skyzh
Copy link
Member

skyzh commented Nov 10, 2022

Are there any disadvantages to spawn too many tasks? 🤔 (BTW how does risingwave do it?

Both streaming and batch engine spawns a task for a fragment.

@wangrunji0408 wangrunji0408 merged commit f56a09c into main Nov 11, 2022
@wangrunji0408 wangrunji0408 deleted the wrj/perf branch November 11, 2022 04:12
@wangrunji0408
Copy link
Member Author

Are there any disadvantages to spawn too many tasks? 🤔

If cancellation is not handled properly, it can leave orphan tasks and leak resources. In addition, too many tasks may cause problems in scheduling, like high latency. But I think in our use case (one task per executor), the number is far less than the limit. So it should be fine. 🤔

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

3 participants