File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed
packages/core/src/v3/runEngineWorker/supervisor Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -42,8 +42,9 @@ const Env = z.object({
4242 TRIGGER_DEQUEUE_SCALING_UP_COOLDOWN_MS : z . coerce . number ( ) . int ( ) . default ( 5000 ) , // 5 seconds
4343 TRIGGER_DEQUEUE_SCALING_DOWN_COOLDOWN_MS : z . coerce . number ( ) . int ( ) . default ( 30000 ) , // 30 seconds
4444 TRIGGER_DEQUEUE_SCALING_TARGET_RATIO : z . coerce . number ( ) . default ( 1.0 ) , // Target ratio of queue items to consumers (1.0 = 1 item per consumer)
45- TRIGGER_DEQUEUE_SCALING_EWMA_ALPHA : z . coerce . number ( ) . min ( 0 ) . max ( 1 ) . default ( 0.3 ) , // EWMA smoothing factor (0-1 )
45+ TRIGGER_DEQUEUE_SCALING_EWMA_ALPHA : z . coerce . number ( ) . min ( 0 ) . max ( 1 ) . default ( 0.3 ) , // Smooths queue length measurements (0=historical, 1=current )
4646 TRIGGER_DEQUEUE_SCALING_BATCH_WINDOW_MS : z . coerce . number ( ) . int ( ) . positive ( ) . default ( 1000 ) , // Batch window for metrics processing (ms)
47+ TRIGGER_DEQUEUE_SCALING_DAMPING_FACTOR : z . coerce . number ( ) . min ( 0 ) . max ( 1 ) . default ( 0.7 ) , // Smooths consumer count changes after EWMA (0=no scaling, 1=immediate)
4748
4849 // Optional services
4950 TRIGGER_WARM_START_URL : z . string ( ) . optional ( ) ,
Original file line number Diff line number Diff line change @@ -138,6 +138,7 @@ class ManagedSupervisor {
138138 targetRatio : env . TRIGGER_DEQUEUE_SCALING_TARGET_RATIO ,
139139 ewmaAlpha : env . TRIGGER_DEQUEUE_SCALING_EWMA_ALPHA ,
140140 batchWindowMs : env . TRIGGER_DEQUEUE_SCALING_BATCH_WINDOW_MS ,
141+ dampingFactor : env . TRIGGER_DEQUEUE_SCALING_DAMPING_FACTOR ,
141142 } ,
142143 runNotificationsEnabled : env . TRIGGER_WORKLOAD_API_ENABLED ,
143144 heartbeatIntervalSeconds : env . TRIGGER_WORKER_HEARTBEAT_INTERVAL_SECONDS ,
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ export type QueueConsumerFactory = (opts: RunQueueConsumerOptions) => QueueConsu
1313
1414export type ScalingOptions = {
1515 strategy ?: ScalingStrategyKind ;
16- strategyOptions ?: ScalingStrategyOptions ;
1716 minConsumerCount ?: number ;
1817 maxConsumerCount ?: number ;
1918 scaleUpCooldownMs ?: number ;
@@ -22,6 +21,7 @@ export type ScalingOptions = {
2221 ewmaAlpha ?: number ;
2322 batchWindowMs ?: number ;
2423 disableJitter ?: boolean ;
24+ dampingFactor ?: number ;
2525} ;
2626
2727export type ConsumerPoolOptions = {
@@ -99,7 +99,7 @@ export class RunQueueConsumerPool {
9999 } ) ;
100100
101101 const targetRatio = opts . scaling . targetRatio ?? 1.0 ;
102- const dampingFactor = opts . scaling . strategyOptions ?. dampingFactor ;
102+ const dampingFactor = opts . scaling . dampingFactor ;
103103
104104 // Create scaling strategy with metrics processor injected
105105 this . scalingStrategy = ScalingStrategy . create ( opts . scaling . strategy ?? "none" , {
You can’t perform that action at this time.
0 commit comments