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

changefeedccl: use numcpu >> 2 workers for event consumers #89659

Merged
merged 1 commit into from
Oct 14, 2022

Conversation

jayshrivastava
Copy link
Contributor

@jayshrivastava jayshrivastava commented Oct 10, 2022

Previously, a default value of 8 was used for the kvevent parallel consumer. The reason for this was that we observed performance improvements in a 15 node 32 VCPU cluster when we increased this parameter to 8. After 8, the improvements were much smaller.

The issue with a default of 8 is that that on smaller machines, 8 workers can be too much overhead, especially since the work is CPU intensive.

This change updates the default to be runtime.NumCPU() >> 2 workers, which aligns with using 8 workers on 32 VCPU machines.

Fixes #89589
Epic: none

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@jayshrivastava jayshrivastava marked this pull request as ready for review October 10, 2022 15:02
@jayshrivastava jayshrivastava requested a review from a team as a code owner October 10, 2022 15:02
if idealNumber < 1 {
return 1
}
return int64(idealNumber)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have prior art to using defaults that could change if e.g. cluster is upsized/moved?

I think we should change the semantics of this setting: -1 disables, 0 -- we pick reasonable default, anything >0 -- we use user provided value.
When we pick default, we should do this logic; but also, let's cap the max at 8.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just pushed updates. I moved the default value calculation to where we initialize the event consumer. This way, we can at least generate a new number whenever a changefeed is started/restarted.

@jayshrivastava jayshrivastava force-pushed the nprocs-default branch 4 times, most recently from f0284a0 to bafa186 Compare October 12, 2022 15:48
@jayshrivastava jayshrivastava force-pushed the nprocs-default branch 3 times, most recently from 9559507 to 29dd10e Compare October 13, 2022 16:35
@HonoreDB
Copy link
Contributor

@miretskiy
Copy link
Contributor

miretskiy commented Oct 13, 2022 via email

@jayshrivastava
Copy link
Contributor Author

jayshrivastava commented Oct 13, 2022

Should this instead use runtime.GOMAXPROCS per the comment here?

Yes, we should. I'll update it.

Previously, a default value of 8 was used for the kvevent parallel consumer.
The reason for this was that we observed performance improvements in a 15 node
32 VCPU cluster when we increased this parameter to 8. After 8, the
improvements were much smaller.

The issue with a default of 8 is that that on smaller machines, 8
workers can be too much overhead, especially since the work is CPU intensive.

This change updates the default to be runtime.NumCPU() >> 2 workers, which
aligns with using 8 workers on 32 VCPU machines.

Fixes cockroachdb#89589
Epic: none

Release note: None
@jayshrivastava
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Oct 14, 2022

Build succeeded:

@craig craig bot merged commit b445bc7 into cockroachdb:master Oct 14, 2022
@jayshrivastava jayshrivastava deleted the nprocs-default branch October 18, 2022 19:38
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.

changefeedccl: Parallel workers default
4 participants