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

SendBatch: Don't start goroutines #232

Merged
merged 2 commits into from
Sep 15, 2023
Merged

Conversation

aaronbee
Copy link
Collaborator

@aaronbee aaronbee commented Aug 24, 2023

Instead of starting goroutines we can queue each region server's collection of RPCs and only after queueing them all wait for all responses. We get a similar amount of parallelism, the only potential slow down is that we can't queue one region server's RPCs until the previous is able to be queued.

By not starting goroutines, the resource usage of SendBatch is more predictable. And not starting goroutines is likely to be less expensive overall.

This change also adds a new metric for number of splits that occur in SendBatch.

@codecov
Copy link

codecov bot commented Aug 24, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01% ⚠️

Comparison is base (701886e) 70.30% compared to head (a67f669) 70.30%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #232      +/-   ##
==========================================
- Coverage   70.30%   70.30%   -0.01%     
==========================================
  Files          27       27              
  Lines        3718     3721       +3     
==========================================
+ Hits         2614     2616       +2     
+ Misses        989      988       -1     
- Partials      115      117       +2     
Files Changed Coverage Δ
rpc.go 85.07% <100.00%> (+0.40%) ⬆️

... and 1 file with indirect coverage changes

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

@aaronbee aaronbee force-pushed the nogobatch branch 2 times, most recently from b980066 to cd1536b Compare August 30, 2023 18:20
@aaronbee
Copy link
Collaborator Author

aaronbee commented Sep 6, 2023

Testing shows this didn't affect performance, so I think this is worth merging because it simplifies thinking about the cost of a SendBatch.

rpc.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@ciacono ciacono left a comment

Choose a reason for hiding this comment

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

The idea behind this makes sense to me, although I do see concern with the potential slowdown because we are doing this sequentially. But having the resource usage being more predictable (and less expensive with less goroutines) seems worthwhile. Other than the comment I left, LGTM.

Instead of starting goroutines we can queue each region server's
collection of RPCs and only after queueing them all wait for all
responses. We get a similar amount of parallelism, the only potential
slow down is that we can't queue one region server's RPCs until the
previous is able to be queued.

By not starting goroutines, the resource usage of SendBatch is more
predictable. And not starting goroutines is likely to be less
expensive overall.
@aaronbee aaronbee merged commit 6b4fbf6 into tsuna:master Sep 15, 2023
3 of 4 checks passed
@aaronbee aaronbee deleted the nogobatch branch September 15, 2023 16: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.

2 participants