InFlightLimit

class InFlightLimit(val max: Int = DEFAULT_MAX)

A node's bound on the commands in flight in its executors (wow.executor.max-in-flight): those taken and not finished, waiting in their lanes or in the kernel. The executors of every context on a node share one, so it bounds the node's memory and the work it queues ahead of its stores, whichever aggregates the commands are for.

The default, DEFAULT_MAX, is sized by Little's law for a slow store: a node whose store commits a few thousand appends a second (a connection pool of tens at a few milliseconds each, the backend's group commit on top) drains 4096 commands in one to two seconds, well within the default 10-second wait; beyond that, queueing longer only turns into wait timeouts, and an early 429 lets the client back off instead. A node with more cores or a larger pool raises it.

Constructors

Link copied to clipboard
constructor(max: Int = DEFAULT_MAX)

Types

Link copied to clipboard

Properties

Link copied to clipboard

The commands in flight now.

Link copied to clipboard
val intakes: Semaphore

The commands the node's command intakes execute at once, all contexts together: half of max, so a node that owns many partitions of a command topic's backlog never fills the bound alone, and the commands of callers, sagas and timers always have the other half.

Link copied to clipboard
val max: Int

Functions

Link copied to clipboard
fun release()

Gives back a place tryAcquire took.

Link copied to clipboard

Takes one place, or false when all max are taken.