Skip to content

Commit c605acb

Browse files
fix(pipeline): escalate idle keepalive backoff to 20s
Previous cap of 2s caused ~1200 requests/5min idle with 15 deployments. New escalation: 20ms→80ms→200ms→500ms→2s→5s→10s→20s. After 15+ consecutive empties, sessions poll every 20s. Estimated idle reduction: ~1200/5min → ~200/5min. Zero latency impact on active traffic — select! races timer against client reads, so real data fires immediately. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b2f8207 commit c605acb

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/tunnel_client.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,8 +1638,10 @@ async fn tunnel_loop(
16381638
0 => Duration::from_millis(20),
16391639
1 => Duration::from_millis(80),
16401640
2 => Duration::from_millis(200),
1641-
3 => Duration::from_millis(500),
1642-
_ => Duration::from_secs(2),
1641+
3 => Duration::from_secs(2),
1642+
4..=7 => Duration::from_secs(5),
1643+
8..=14 => Duration::from_secs(10),
1644+
_ => Duration::from_secs(20),
16431645
};
16441646
if consecutive_empty > 0 {
16451647
// Wait for either the backoff timer or client data.

0 commit comments

Comments
 (0)