Documentation
¶
Overview ¶
Package adaptive implements an adaptive batch scheduler that dynamically adjusts batch size based on queue depth and latency targets to maximize throughput while meeting latency SLOs. (Stability: beta)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Batcher ¶
type Batcher struct {
// contains filtered or unexported fields
}
Batcher dynamically adjusts batch size based on queue depth and latency.
func (*Batcher) LatencyEMA ¶
LatencyEMA returns the current exponential moving average latency in ms.
type Config ¶
type Config struct {
// MinBatchSize is the smallest batch the batcher will form (default 1).
MinBatchSize int
// MaxBatchSize is the largest batch the batcher will form (default 32).
MaxBatchSize int
// TargetLatencyMS is the latency SLO in milliseconds. When the
// exponential moving average of batch latency exceeds this target,
// the batcher decreases the batch size.
TargetLatencyMS float64
// QueueTimeoutMS is how long (in ms) the batcher waits to fill a batch
// before dispatching whatever it has collected (default 50).
QueueTimeoutMS float64
}
Config controls the adaptive batcher.
Click to show internal directories.
Click to hide internal directories.