multitenant: only charge for pgwire egress and update cost model settings#71094
multitenant: only charge for pgwire egress and update cost model settings#71094craig[bot] merged 3 commits intocockroachdb:masterfrom
Conversation
|
pkg/kv/kvserver/tenantrate/settings.go, line 55 at r2 (raw file):
Not very sure how to go about setting this. Definitely seems like we should increase it, now that writes are 5x more expensive and reads are 2x. |
6e3fc19 to
4c92953
Compare
|
Updated - I added a commit that revives the separate tenantrate limiter settings; cost model changes no longer affect that subsystem. |
andy-kimball
left a comment
There was a problem hiding this comment.
Do you foresee any problems if we upgrade from the previous code to this code in our Staging/Production environments?
Reviewable status:
complete! 1 of 0 LGTMs obtained (waiting on @ajwerner and @RaduBerinde)
pkg/kv/kvserver/tenantrate/settings.go, line 52 at r5 (raw file):
// seconds), so it doesn't need to be adjusted in concert with the rate. var ( // kvcuRateLimit was initially set to an absolute value in KV Compute Units/s,
NIT: Somewhere in here, can you add a comment explaining the difference between the constants used in distributed rate limiting vs. the constants used in KV tenant throttling?
4c92953 to
7641be8
Compare
RaduBerinde
left a comment
There was a problem hiding this comment.
TFTR! There should be no problem upgrading.
Reviewable status:
complete! 1 of 0 LGTMs obtained (waiting on @ajwerner)
pkg/kv/kvserver/tenantrate/settings.go, line 52 at r5 (raw file):
Previously, andy-kimball (Andy Kimball) wrote…
NIT: Somewhere in here, can you add a comment explaining the difference between the constants used in distributed rate limiting vs. the constants used in KV tenant throttling?
Done, PTAL
Sharing the same cost model for tenant costing and for KV-side tenant limiting was a mistake - the latter is meant to estimate CPU usage as much as possible whereas we want to take arbitrary freedoms with tenant costing. This commit revives the `kv.tenant_rate_limiter.*` settings for the cost model and reverts to using the concept of "KV Compute Units" inside the rate limiter. 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.
This commit changes the tenant cost accounting for pgwire bytes to only take into account egress; cloud providers don't charge for ingress. In the future, we can plumb the ingress bytes separately if needed - as of now we don't plan to charge for ingress. 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.
This commit updates settings for the tenant cost model. These values are derived from the Tenant Pricing Model spreadsheet. 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.
7641be8 to
28ff523
Compare
|
bors r+ |
|
Build succeeded: |
|
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 56b8c5d to blathers/backport-release-21.2-71094: 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.x failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
tenantrate: revive KV Compute Units
Sharing the same cost model for tenant costing and for KV-side tenant
limiting was a mistake - the latter is meant to estimate CPU usage as
much as possible whereas we want to take arbitrary freedoms with
tenant costing.
This commit revives the
kv.tenant_rate_limiter.*settings for thecost model and reverts to using the concept of "KV Compute Units"
inside the rate limiter.
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.
multitenant: only charge for pgwire egress
This commit changes the tenant cost accounting for pgwire bytes to
only take into account egress; cloud providers don't charge for
ingress. In the future, we can plumb the ingress bytes separately if
needed - as of now we don't plan to charge for ingress.
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.
tenantcostmodel: update settings
This commit updates settings for the tenant cost model. These values
are derived from the Tenant Pricing Model spreadsheet.
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.