Skip to content

Commit

Permalink
admission: Disable AC for user requests
Browse files Browse the repository at this point in the history
informs: cockroachdb#85641

Only leave admission control in place for elastic / bulk requests.

Release note: None
  • Loading branch information
andrewbaptist committed Oct 21, 2022
1 parent 081f108 commit fa7fb3a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/generated/settings/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<tr><td><code>admission.epoch_lifo.epoch_closing_delta_duration</code></td><td>duration</td><td><code>5ms</code></td><td>the delta duration before closing an epoch, for epoch-LIFO admission control ordering</td></tr>
<tr><td><code>admission.epoch_lifo.epoch_duration</code></td><td>duration</td><td><code>100ms</code></td><td>the duration of an epoch, for epoch-LIFO admission control ordering</td></tr>
<tr><td><code>admission.epoch_lifo.queue_delay_threshold_to_switch_to_lifo</code></td><td>duration</td><td><code>105ms</code></td><td>the queue delay encountered by a (tenant,priority) for switching to epoch-LIFO ordering</td></tr>
<tr><td><code>admission.kv.bulk_only.enabled</code></td><td>boolean</td><td><code>false</code></td><td>when both admission.kv.enabled and this is true, only throttle bulk work</td></tr>
<tr><td><code>admission.kv.enabled</code></td><td>boolean</td><td><code>true</code></td><td>when true, work performed by the KV layer is subject to admission control</td></tr>
<tr><td><code>admission.kv.stores.tenant_weights.enabled</code></td><td>boolean</td><td><code>false</code></td><td>when true, tenant weights are enabled for KV-stores admission control</td></tr>
<tr><td><code>admission.kv.tenant_weights.enabled</code></td><td>boolean</td><td><code>false</code></td><td>when true, tenant weights are enabled for KV admission control</td></tr>
Expand Down
7 changes: 7 additions & 0 deletions pkg/kv/kvserver/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -3910,6 +3910,13 @@ func (n *KVAdmissionControllerImpl) AdmitKVWork(
if source == roachpb.AdmissionHeader_OTHER {
bypassAdmission = true
}
// TODO(abaptist): Revisit and deprecate this setting in v23.1.
if admission.KVBulkOnlyAdmissionControlEnabled.Get(&n.settings.SV) {
if admissionpb.WorkPriority(ba.AdmissionHeader.Priority) >= admissionpb.NormalPri {
bypassAdmission = true
}
}

createTime := ba.AdmissionHeader.CreateTime
if !bypassAdmission && createTime == 0 {
// TODO(sumeer): revisit this for multi-tenant. Specifically, the SQL use
Expand Down
10 changes: 10 additions & 0 deletions pkg/util/admission/work_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ var KVAdmissionControlEnabled = settings.RegisterBoolSetting(
"when true, work performed by the KV layer is subject to admission control",
true).WithPublic()

// KVBulkOnlyAdmissionControlEnabled controls whether user (normal and above
// priority) work is subject to admission control. If it is set to true, then
// user work will not be throttled by admission control but bulk work still will
// be.
var KVBulkOnlyAdmissionControlEnabled = settings.RegisterBoolSetting(
settings.SystemOnly,
"admission.kv.bulk_only.enabled",
"when both admission.kv.enabled and this is true, only throttle bulk work",
false).WithPublic()

// SQLKVResponseAdmissionControlEnabled controls whether response processing
// in SQL, for KV requests, is enabled.
var SQLKVResponseAdmissionControlEnabled = settings.RegisterBoolSetting(
Expand Down

0 comments on commit fa7fb3a

Please sign in to comment.