-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
This is a performance issue and a proposal to enhance performance / throughput.
Problem
ProxyServer::handle_http_request opens a fresh TcpStream::connect and performs a new Hyper HTTP/1.1 client handshake for every incoming request. This disables keep‑alive reuse and adds per‑request connection overhead (DNS resolution, TCP handshake, HTTP handshake).
- File:
src/lib.rs - Function:
ProxyServer::handle_http_request
Impact
- Throughput is limited by connection setup rather than request handling.
- Higher latency under load.
- Increased CPU usage and ephemeral port churn.
Proposed fix
Introduce outbound connection reuse:
- Maintain a persistent HTTP client connection to the target service.
- Prefer HTTP/2 upstream when available to multiplex requests.
- Avoid
TcpStream::connectper request.
Acceptance criteria
- Outbound connections are reused across multiple requests (observable via logs).
- Nice to have: throughput improves in a load test vs. current baseline.
- No regression in proxy correctness (headers, attestation metadata, error handling).
Notes
The current code creates the outbound connection here:
src/lib.rs→ProxyServer::handle_http_request(TcpStream::connect,http1::Builder::handshake).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request