Documentation
¶
Overview ¶
Package overload implements a 5-stage degradation ladder for backpressure and load shedding.
The overload manager monitors CPU utilization and progressively escalates through stages: Normal → Expand → Reap → Reorder → Backpressure → Reject. Each stage applies engine hooks to shed load. De-escalation requires sustained improvement and respects per-stage cooldown timers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Enabled bool
Stages [6]StageConfig
Interval time.Duration
}
Config configures the overload manager.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the default overload configuration per SDD 10.1.
type EngineHooks ¶
type EngineHooks interface {
ExpandWorkers(maxWorkers int) int
ReapIdleConnections(idleThreshold time.Duration) int
SetSchedulingMode(lifo bool)
SetAcceptPaused(paused bool)
SetAcceptDelay(d time.Duration)
SetMaxConcurrent(n int)
ShrinkWorkers(baseWorkers int, idleThreshold time.Duration) int
ActiveConnections() int64
WorkerCount() int
}
EngineHooks is the interface engines implement to respond to overload actions. The overload package does not import any engine package.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager monitors CPU utilization and drives a 5-stage degradation ladder.
func NewManager ¶
NewManager creates an overload manager.
func (*Manager) SetFreezeHook ¶
SetFreezeHook registers a callback for freeze/unfreeze (adaptive engine integration).
type Stage ¶
type Stage uint8
Stage represents the current overload degradation level.