-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
flowinfra: make max_running_flows default depend on the number of CPUs #71787
Conversation
c84a8a7
to
a58a751
Compare
I haven't run any benchmarks for the choice of 128 as the multiple but based it on a recent stress test I did. There, I used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're changing the default to be a multiple of cores, it might be simpler semantically to change the meaning of the variable to be per-core, and then make the default a constant 128.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @RaduBerinde)
a58a751
to
414a78e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it would be nice to make the 128 itself configurable.
What I did elsewhere (#70328) was keep the "absolute" meaning for positive values and add a "per-CPU" meaning for negative value (e.g. 500 means limit=500, -100 means 100*GOMAXPROCS). It's a bit hacky but handles previously changed values well.
Reviewable status:
complete! 0 of 0 LGTMs obtained
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I did elsewhere (#70328) was keep the "absolute" meaning for positive values and add a "per-CPU" meaning for negative value (e.g. 500 means limit=500, -100 means 100*GOMAXPROCS).
🤯 Nice.
Reviewable status:
complete! 0 of 0 LGTMs obtained
414a78e
to
f87625b
Compare
We think that it makes sense to scale the default value for `max_running_flows` based on how beefy the machines are, so we make it a multiple of the number of available CPU cores. We do so in a backwards-compatible fashion by treating the positive values of `sql.distsql.max_running_flows` as absolute values (the previous meaning) and the negative values as multiples of the number of the CPUs. The choice of 128 as the default multiple is driven by the old default value of 500 and is such that if we have 4 CPUs, then we'll get the value of 512, pretty close to the old default. Release note (ops change): The meaning of `sql.distsql.max_running_flows` cluster setting has been extended so that when the value is negative, it would be multiplied by the number of CPUs on the node to get the maximum number of concurrent remote flows on the node. The default value is -128, meaning that on a 4 CPU machine we will have up to 512 concurrent remote DistSQL flows, but on a 8 CPU machine up to 1024. The previous default was 500.
f87625b
to
53273ea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, these are interesting ideas, implemented both suggestions.
Reviewable status:
complete! 0 of 0 LGTMs obtained
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status:
complete! 1 of 0 LGTMs obtained
TFTRs! bors r+ |
Build succeeded: |
blathers backport 21.2 |
Encountered an error creating backports. Some common things that can go wrong:
You might need to create your backport manually using the backport tool. error creating merge commit from 53273ea to blathers/backport-release-21.2-71787: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch 21.2 failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
We think that it makes sense to scale the default value for
max_running_flows
based on how beefy the machines are, so we make it amultiple of the number of available CPU cores. We do so in
a backwards-compatible fashion by treating the positive values of
sql.distsql.max_running_flows
as absolute values (the previousmeaning) and the negative values as multiples of the number of the CPUs.
The choice of 128 as the default multiple is driven by the old default
value of 500 and is such that if we have 4 CPUs, then we'll get the value
of 512, pretty close to the old default.
Informs: #34229.
Release note (ops change): The meaning of
sql.distsql.max_running_flows
cluster setting has been extended sothat when the value is negative, it would be multiplied by the number of
CPUs on the node to get the maximum number of concurrent remote flows on
the node. The default value is -128, meaning that on a 4 CPU machine we
will have up to 512 concurrent remote DistSQL flows, but on a 8 CPU
machine up to 1024. The previous default was 500.