Skip to content

Add configurable upstream connection limits#235

Merged
umputun merged 2 commits intomasterfrom
feature/upstream-connection-limits
Nov 27, 2025
Merged

Add configurable upstream connection limits#235
umputun merged 2 commits intomasterfrom
feature/upstream-connection-limits

Conversation

@umputun
Copy link
Owner

@umputun umputun commented Nov 27, 2025

Summary

  • Add new --upstream.max-idle-conns option to configure max idle connections total (default: 100)
  • Add new --upstream.max-conns option to configure max connections per upstream host (default: 0, unlimited)
  • Replace hardcoded MaxIdleConns: 100 with configurable value
  • Defaults maintain backward compatibility

Usage:

reproxy --upstream.max-conns=50 --upstream.max-idle-conns=200
# or via environment
UPSTREAM_MAX_CONNS=50 UPSTREAM_MAX_IDLE_CONNS=200 reproxy

Related to #159

Add new --upstream.max-idle-conns and --upstream.max-conns options
to configure the HTTP transport connection pool settings.

- max-idle-conns: max idle connections total (default: 100)
- max-conns: max connections per upstream host, 0=unlimited (default: 0)

This allows users to limit concurrent connections to backend servers,
preventing connection exhaustion when upstreams have limited capacity.

Related to #159
Use require.Eventually to wait for server readiness instead of
fixed sleep, preventing connection refused errors on CI.
@umputun umputun merged commit c9c8414 into master Nov 27, 2025
3 checks passed
@umputun umputun deleted the feature/upstream-connection-limits branch November 27, 2025 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant