Skip to content

Commit 2e135d7

Browse files
vahidlazioclaude
andcommitted
tune: max elevation=10 total (not per-deployment), max inflight=2
- MAX_ELEVATED_PER_DEPLOYMENT → MAX_ELEVATED_TOTAL = 10: flat cap across all deployments instead of multiplied per script - INFLIGHT_ACTIVE 4→2: lower max pipeline depth Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4e1b3d7 commit 2e135d7

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/tunnel_client.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ const INFLIGHT_OPTIMIST: usize = 1;
7373

7474
/// Maximum pipeline depth when data is actively flowing. Ramps up on
7575
/// data-bearing replies, drops back to IDLE after consecutive empties.
76-
const INFLIGHT_ACTIVE: usize = 4;
76+
const INFLIGHT_ACTIVE: usize = 2;
7777

7878
/// How many consecutive empty replies before dropping from active to idle depth.
7979
const INFLIGHT_COOLDOWN: u32 = 3;
8080

81-
/// Max sessions that can run at elevated pipeline depth per deployment.
82-
const MAX_ELEVATED_PER_DEPLOYMENT: u64 = 2;
81+
/// Max sessions that can run at elevated pipeline depth (total, not per deployment).
82+
const MAX_ELEVATED_TOTAL: u64 = 10;
8383

8484
/// Adaptive coalesce defaults: after each new op arrives, wait another
8585
/// step for more ops. Resets on every arrival, up to max from the first
@@ -442,7 +442,7 @@ impl TunnelMux {
442442
.batch_timeout()
443443
.saturating_add(REPLY_TIMEOUT_SLACK);
444444
pipeline_debug::set_limits(
445-
MAX_ELEVATED_PER_DEPLOYMENT * unique_n as u64,
445+
MAX_ELEVATED_TOTAL,
446446
(CONCURRENCY_PER_DEPLOYMENT * unique_n) as u64,
447447
);
448448
let (tx, rx) = mpsc::unbounded_channel();
@@ -462,7 +462,7 @@ impl TunnelMux {
462462
unreachable_cache: Mutex::new(HashMap::new()),
463463
reply_timeout,
464464
elevated_sessions: AtomicU64::new(0),
465-
max_elevated: MAX_ELEVATED_PER_DEPLOYMENT * unique_n as u64,
465+
max_elevated: MAX_ELEVATED_TOTAL,
466466
})
467467
}
468468

@@ -2200,7 +2200,7 @@ mod tests {
22002200
// `fronter.batch_timeout()` (see `TunnelMux::start`).
22012201
reply_timeout: Duration::from_secs(35),
22022202
elevated_sessions: AtomicU64::new(0),
2203-
max_elevated: MAX_ELEVATED_PER_DEPLOYMENT * num_scripts as u64,
2203+
max_elevated: MAX_ELEVATED_TOTAL,
22042204
});
22052205
(mux, rx)
22062206
}

0 commit comments

Comments
 (0)