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

tenantrate: relax host-side tenant rate limit #70328

Merged
merged 1 commit into from
Sep 18, 2021

Conversation

RaduBerinde
Copy link
Member

Tenants will now be primarily throttled from the client side. This
change increases the existing per-KV-node limit from an absolute 200
RU/s to 200 RU/s per CPU. This should roughly map to 20% of the
capacity of a node. The reasoning is that we can limit the
user-observed variability in performance if we prevent them from
taking full advantage of an underloaded node. This also works as a
mechanism to limit the possibility of a tenant single-handedly
overloading a KV node.

This increase is necessary to provide good performance to
non-throttled (paying) tenants.

We implement this change in a backward-compatible way by continuing to
support setting absolute rates with
kv.tenant_rate_limiter.rate_limit; we now use negative values to
indicate per-CPU rates.

Tested by checking for the log during TestTenantRateLimiter:

tenantrate limiter initialized (rate: 2400 RU/s; burst: 24000 RU)

Release note: None

Release justification: Necessary fix to support paid Serverless
tenants. This functionality is only enabled in multi-tenant scenarios
and should have no impact on our dedicated customers.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@RaduBerinde RaduBerinde force-pushed the relax-kv-side-throttling branch from b34f94b to 35ee145 Compare September 16, 2021 20:17
Copy link
Contributor

@andy-kimball andy-kimball left a comment

Choose a reason for hiding this comment

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

:lgtm:, clever way to get 20% of node capacity.

@darinpp, looks like Radu has got this change covered.

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @ajwerner)

@RaduBerinde RaduBerinde force-pushed the relax-kv-side-throttling branch from 35ee145 to f681a55 Compare September 17, 2021 18:55
Tenants will now be primarily throttled from the client side. This
change increases the existing per-KV-node limit from an absolute 200
RU/s to 200 RU/s *per CPU*. This should roughly map to 20% of the
capacity of a node. The reasoning is that we can limit the
user-observed variability in performance if we prevent them from
taking full advantage of an underloaded node. This also works as a
mechanism to limit the possibility of a tenant single-handedly
overloading a KV node.

This increase is necessary to provide good performance to
non-throttled (paying) tenants.

We implement this change in a backward-compatible way by continuing to
support setting absolute rates with
`kv.tenant_rate_limiter.rate_limit`; we now use negative values to
indicate per-CPU rates.

Tested by checking for the log during TestTenantRateLimiter:
```
tenantrate limiter initialized (rate: 2400 RU/s; burst: 24000 RU)
```

Release note: None

Release justification: Necessary fix to support paid Serverless
tenants. This functionality is only enabled in multi-tenant scenarios
and should have no impact on our dedicated customers.
@RaduBerinde RaduBerinde force-pushed the relax-kv-side-throttling branch from f681a55 to 4f77a8e Compare September 17, 2021 22:10
@RaduBerinde
Copy link
Member Author

bors r+

@craig
Copy link
Contributor

craig bot commented Sep 18, 2021

Build succeeded:

@craig craig bot merged commit 34737cc into cockroachdb:master Sep 18, 2021
@RaduBerinde RaduBerinde deleted the relax-kv-side-throttling branch September 21, 2021 20:47
RaduBerinde added a commit to RaduBerinde/cockroach that referenced this pull request Sep 24, 2021
A recent change (cockroachdb#70328) increased the rate limit and that exposed a
fragility in this test. This change restores the test to use the
original (small) rate limit.

Fixes cockroachdb#70456.

Release note: None

Release justification: test-only fix.
craig bot pushed a commit that referenced this pull request Sep 25, 2021
70723: kv: deflake TestTenantRateLimiter r=RaduBerinde a=RaduBerinde

A recent change (#70328) increased the rate limit and that exposed a
fragility in this test. This change restores the test to use the
original (small) rate limit.

Fixes #70456.

Release note: None

Release justification: test-only fix.

Co-authored-by: Radu Berinde <[email protected]>
blathers-crl bot pushed a commit that referenced this pull request Sep 25, 2021
A recent change (#70328) increased the rate limit and that exposed a
fragility in this test. This change restores the test to use the
original (small) rate limit.

Fixes #70456.

Release note: None

Release justification: test-only fix.
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.

3 participants