-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
release-22.2: add elastic CPU control to CDC event processing #92764
Merged
jayshrivastava
merged 3 commits into
cockroachdb:release-22.2
from
jayshrivastava:backport-elastic-nprocs
Dec 1, 2022
Merged
release-22.2: add elastic CPU control to CDC event processing #92764
jayshrivastava
merged 3 commits into
cockroachdb:release-22.2
from
jayshrivastava:backport-elastic-nprocs
Dec 1, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Currently, the Pacer type is only used within KV, but will be used by SQL in future changes. For example, code for encoding/decoding CDC events resides in distSQL and is CPU intensive, so there is a plan to integrate admission control to it in (cockroachdb#90089). This change makes the Pacer type available to the SQL layer via the `execinfra.ServerConfig`. Because the Pacer was previously only used by KV, it lived in the `kvadmission` package. Since this change makes it available outside of KV, it is moved to the `admission` package. Furthermore, this change adds a new method, `ElasticCPUGrantCoordinator.NewPacer`, to instantiate new Pacer structs. Since the `ElasticCPUGrantCoordinator` implements several features not relevant to SQL, this change passes the coordinator to the SQL server config as the interface `PacerMaker`, which makes only the `NewPacer` method accessible. Currently tenant servers do not create grant coordinators for admission control. This change retains that behavior, except it passes a `nil ElasticCPUGrandCoordinator` which creates `nil`/noop Pacers. Adding these coordinators to tenant servers is a change outside the scope of this commit and is left as a `TODO`. Release note: None
Previously, the CPU-bound work of CDC event processing (encoding / decoding rows) had the potential to consume a lot of CPU and disrupt foreground SQL traffic. This changes adds elastic CPU control to event processing so that it does not use excessive CPU and starve foreground traffic. This change also adds a new, non-public cluster setting, which controls enabling/disabling CPU control for CDC event processing and controlling the requested grant size measured in CPU time. Fixes: cockroachdb#90089 Release note: None
This commit is being backported to 22.2, so this setting is being disabled by default to error on the side of caution. Release note: None
Thanks for opening a backport. Please check the backport criteria before merging:
If some of the basic criteria cannot be satisfied, ensure that the exceptional criteria are satisfied within.
Add a brief release justification to the body of your PR to justify this backport. Some other things to consider:
|
jayshrivastava
changed the title
release-22.2: add elastic cpu control
release-22.2: add elastic CPU control to CDC event processing
Nov 30, 2022
miretskiy
approved these changes
Dec 1, 2022
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.
👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport 2/3 commits from #91554.
Also add a new commit which disables the feature by default.
Also verified that CI passes with the last commit omitted (ie. with CPU control enabled)
/cc https://github.com/orgs/cockroachdb/teams/release
admission: make Pacer type available in SQL server config
Currently, the Pacer type is only used within KV, but will be used by SQL
in future changes. For example, code for encoding/decoding CDC events resides
in distSQL and is CPU intensive, so there is a plan to integrate admission
control to it in (#90089).
This change makes the Pacer type available to the SQL layer via the
execinfra.ServerConfig
.Because the Pacer was previously only used by KV, it lived in the
kvadmission
package. Since this change makes it available outside of KV, it is moved to
the
admission
package.Furthermore, this change adds a new method,
ElasticCPUGrantCoordinator.NewPacer
, to instantiate new Pacer structs.Since the
ElasticCPUGrantCoordinator
implements several features not relevantto SQL, this change passes the coordinator to the SQL server config as
the interface
PacerMaker
, which makes only theNewPacer
method accessible.Currently tenant servers do not create grant coordinators for admission
control. This change retains that behavior, except it passes a
nil
ElasticCPUGrandCoordinator
which createsnil
/noop Pacers. Adding thesecoordinators to tenant servers is a change outside the scope of this commit and
is left as a
TODO
.Release note: None
cdc: add elastic CPU control to CDC event processing
Previously, the CPU-bound work of CDC event processing (encoding /
decoding rows) had the potential to consume a lot of CPU and
disrupt foreground SQL traffic. This changes adds elastic CPU control
to event processing so that it does not use excessive CPU and
starve foreground traffic.
This change also adds two new, non-public cluster settings, which control
enabling/disabling CPU control for CDC event processing and controlling
the requested grant size measured in CPU time.
Fixes: #90089
Release note: None
cdc: disable event consumer elastic cpu control by default
This commit is being backported to 22.2, so this setting is
being disabled by default to error on the side of caution.
Release note: None
Release justification: This change reduces SQL latency spikes / increases caused by changefeeds. This change is disabled by default behind a cluster setting.