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(streaming): all stateful executors can try spill when chunk comes #13751

Merged
merged 4 commits into from
Dec 8, 2023

Conversation

wcy-fdu
Copy link
Contributor

@wcy-fdu wcy-fdu commented Nov 30, 2023

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

Previously we have introduced mem table spill for hash_join, dynamic filter and materialized executor, which can reduce oom risk.
Other stateful exeutors, like top_n may also suffer from big mem table, so this pr add spill for all stateful executors.

perf test result: http://metabase.risingwave-cloud.xyz/dashboard/241-nexmark-blackhole-1cn-anti-affinity-rw-avg-source-throughput?start_date=2023-12-06&namespace=

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added test labels as necessary. See details.
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

@wcy-fdu wcy-fdu marked this pull request as draft November 30, 2023 09:24
@wcy-fdu wcy-fdu changed the title feat(streaming): all stateful executors can try spill when chunk comes feat(streaming): all stateful executors can try spill when chunk comes[WIP] Nov 30, 2023
Copy link

codecov bot commented Nov 30, 2023

Codecov Report

Attention: 11 lines in your changes are missing coverage. Please review.

Comparison is base (5af41d3) 68.31% compared to head (200990b) 68.30%.
Report is 18 commits behind head on main.

Files Patch % Lines
...c/stream/src/executor/source/fs_source_executor.rs 0.00% 6 Missing ⚠️
...tream/src/executor/top_n/group_top_n_appendonly.rs 0.00% 3 Missing ⚠️
src/stream/src/executor/hash_agg.rs 87.50% 1 Missing ⚠️
src/stream/src/executor/simple_agg.rs 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13751      +/-   ##
==========================================
- Coverage   68.31%   68.30%   -0.01%     
==========================================
  Files        1527     1527              
  Lines      262575   262615      +40     
==========================================
+ Hits       179378   179380       +2     
- Misses      83197    83235      +38     
Flag Coverage Δ
rust 68.30% <72.50%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wcy-fdu wcy-fdu marked this pull request as ready for review December 4, 2023 05:34
@kwannoel
Copy link
Contributor

kwannoel commented Dec 4, 2023

Thanks for the PR. Can we run benchmark on this to make sure no performance degradation?

@wcy-fdu
Copy link
Contributor Author

wcy-fdu commented Dec 4, 2023

Thanks for the PR. Can we run benchmark on this to make sure no performance degradation?

Sure, I will perf this pr with daily benchmark later.

@wcy-fdu wcy-fdu changed the title feat(streaming): all stateful executors can try spill when chunk comes[WIP] feat(streaming): all stateful executors can try spill when chunk comes Dec 4, 2023
@st1page st1page requested a review from stdrc December 5, 2023 07:32
stdrc
stdrc previously approved these changes Dec 5, 2023
Copy link
Member

@stdrc stdrc left a comment

Choose a reason for hiding this comment

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

LGTM, wait for benchmark

src/stream/src/executor/hash_agg.rs Outdated Show resolved Hide resolved
stdrc

This comment was marked as duplicate.

@stdrc stdrc dismissed their stale review December 5, 2023 16:34

miss action

@fuyufjh
Copy link
Member

fuyufjh commented Dec 7, 2023

Please fill the PR description..

@wcy-fdu
Copy link
Contributor Author

wcy-fdu commented Dec 7, 2023

Copy link
Contributor

@kwannoel kwannoel left a comment

Choose a reason for hiding this comment

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

LGTM as well. Waiting for results.

@wcy-fdu
Copy link
Contributor Author

wcy-fdu commented Dec 7, 2023

perf test result: http://metabase.risingwave-cloud.xyz/dashboard/241-nexmark-blackhole-1cn-anti-affinity-rw-avg-source-throughput?start_date=2023-12-06&namespace=

  • q3: 882->830
  • q5: 140->176
  • q7-rewrite: 975->926
  • q8: 727->753
  • q15: 487->503
  • q16: 141->151
  • q20: 394->410
  • q101: 403->428
  • q102: 255->270
  • q103: 614->641
  • q105: 300->340

In short, The performance of q3 and q7-rewrite has slightly decreased, and the other performance listed here has improved. The performance of the remaining unlisted queries remains basically unchanged.

Not sure if this is expected behavior, but the performance of most queries has actually improved. cc @stdrc @st1page

@st1page
Copy link
Contributor

st1page commented Dec 8, 2023

perf test result: http://metabase.risingwave-cloud.xyz/dashboard/241-nexmark-blackhole-1cn-anti-affinity-rw-avg-source-throughput?start_date=2023-12-06&namespace=

  • q3: 882->830
  • q5: 140->176
  • q7-rewrite: 975->926
  • q8: 727->753
  • q15: 487->503
  • q16: 141->151
  • q20: 394->410
  • q101: 403->428
  • q102: 255->270
  • q103: 614->641
  • q105: 300->340

In short, The performance of q3 and q7-rewrite has slightly decreased, and the other performance listed here has improved. The performance of the remaining unlisted queries remains basically unchanged.

Not sure if this is expected behavior, but the performance of most queries has actually improved. cc @stdrc @st1page

q3 and q7-rewrite's degression LGTM and the performance is just similar to the nightly1203

I used to think the performance increase is because the memtable consumes less memory and the operator cache can consume more. But the metrics give the opposite phenomenon
q5 this branch
image
q5 nightly1205
image

I guess it is because the backpressure becomes more sensitive and make spikes smoother
q5 this branch
image
q5 nightly1205
image

Generally, the PR LGTM and I do not see negative effects...

@wcy-fdu
Copy link
Contributor Author

wcy-fdu commented Dec 8, 2023

spikes

I see, thanks. So let's merge.

@wcy-fdu wcy-fdu requested review from stdrc and kwannoel December 8, 2023 07:10
@wcy-fdu wcy-fdu added this pull request to the merge queue Dec 8, 2023
Merged via the queue into main with commit 4efcc3b Dec 8, 2023
6 of 7 checks passed
@wcy-fdu wcy-fdu deleted the wcy/all_stateful_executor_can_spill branch December 8, 2023 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants