Interface QueueBackpressure
-
public interface QueueBackpressureNative Queue Backpressure mechanism. If the queue fills up aboveDatabaseDescriptor.getNativeTransportQueueMaxItemAgeThreshold(). In other words, request has been sitting more than a % ofDatabaseDescriptor.getNativeTransportQueueMaxItemAgeThreshold()in the queue, we start an incident.Incident starts by marking the incident time and raising severity level to 1. Each time we observe an old item in the head of the queue, we first bump then number of times we have applied the backpressure. After bumping it 10 times, we increase severity level by 1.
Backpressure delay applied to the client socket is computed by multiplying the severity level by the minimum delay.
If we have not seen old requests in the head of the queue for 1 second, we close the incident.
If the queue remains saturated for a prolonged period (meaning
returns false), the amount of delay will increase in proportion to the request rate as appliedTimes & severityLevel are incremented. If no new requests are considered overloaded in this way for a second, the incident will be reset and so the delay will drop back down to {@link Impl#minDelayNanos()}.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classQueueBackpressure.Impl
-
Field Summary
Fields Modifier and Type Field Description static QueueBackpressureDEFAULTstatic QueueBackpressureNO_OP
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description longmarkAndGetDelay(java.util.concurrent.TimeUnit timeUnit)static QueueBackpressure.ImplnoBackpressure(java.util.function.LongSupplier minDelayNanos, java.util.function.LongSupplier maxDelayNanos)
-
-
-
Field Detail
-
NO_OP
static final QueueBackpressure NO_OP
-
DEFAULT
static final QueueBackpressure DEFAULT
-
-
Method Detail
-
markAndGetDelay
long markAndGetDelay(java.util.concurrent.TimeUnit timeUnit)
-
noBackpressure
static QueueBackpressure.Impl noBackpressure(java.util.function.LongSupplier minDelayNanos, java.util.function.LongSupplier maxDelayNanos)
-
-