multitenant: add pgwire bytes component to tenant cost#70877
Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom Sep 30, 2021
Merged
multitenant: add pgwire bytes component to tenant cost#70877craig[bot] merged 1 commit intocockroachdb:masterfrom
craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
Member
ajwerner
approved these changes
Sep 29, 2021
Contributor
ajwerner
left a comment
There was a problem hiding this comment.
needs some rewrites for the virtual table logic tests.
Reviewed 7 of 23 files at r1, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @andy-kimball and @RaduBerinde)
pkg/multitenant/cost_controller.go, line 43 at r1 (raw file):
// - pgwireBytes: total bytes transferred between the client and the SQL // instance (both ingress and egress). type ExternalUsageFn func(ctx context.Context) (cpuSecs float64, pgwireBytes uint64)
Thoughts on adding a struct rather than an ever-expanding set of return params?
This commit adds accounting for the total number of bytes transferred through pgwire. We currently just passively record the usage, similar to CPU. In the future, we will consider throttling the sending of data to the client. The tenant cost model setting is a preliminary guess, we are in the process of revisiting all the values. Release note: None Release justification: Necessary fix for the distributed rate limiting functionality, which is vital for the upcoming Serverless MVP release. It allows CRDB to throttle clusters that have run out of free or paid request units (which measure CPU and I/O usage). This functionality is only enabled in multi-tenant scenarios and should have no impact on our dedicated customers.
7def570 to
f2da943
Compare
RaduBerinde
commented
Sep 29, 2021
Member
Author
RaduBerinde
left a comment
There was a problem hiding this comment.
TFTR!
Reviewable status:
complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @ajwerner and @andy-kimball)
pkg/multitenant/cost_controller.go, line 43 at r1 (raw file):
Previously, ajwerner wrote…
Thoughts on adding a struct rather than an ever-expanding set of return params?
Done.
Member
Author
|
bors r+ |
15 tasks
Contributor
|
Build failed (retrying...): |
Contributor
|
Build succeeded: |
This file contains hidden or 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
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.
This commit adds accounting for the total number of bytes transferred
through pgwire.
We currently just passively record the usage, similar to CPU. In the
future, we will consider throttling the sending of data to the client.
The tenant cost model setting is a preliminary guess, we are in the
process of revisiting all the values.
Release note: None
Release justification: Necessary fix for the distributed rate limiting
functionality, which is vital for the upcoming Serverless MVP release.
It allows CRDB to throttle clusters that have run out of free or paid
request units (which measure CPU and I/O usage). This functionality is
only enabled in multi-tenant scenarios and should have no impact on
our dedicated customers.
Informs #68479.