Skip to content

Proxy client serializes requests on a single connection (no concurrency) #118

@ameba23

Description

@ameba23

This is a performance issue, and a proposed enhancement to increase throughput.

Problem

ProxyClient::new_with_inner forwards all incoming requests through a single sender in a single async loop. Each request awaits sender.send_request(req) before the next is handled, which serializes all proxy traffic.

Impact

  • Throughput is capped by per‑request round‑trip time.
  • Head‑of‑line blocking under concurrency.
  • Even with HTTP/2 negotiated, the implementation does not drive multiplexed concurrency.

Suggested fix

Enable concurrent sending:

  • For HTTP/2, clone the sender and dispatch requests concurrently (bounded).
  • For HTTP/1, consider multiple outbound connections or a small pool to parallelize.
  • Keep a per‑connection concurrency limit to avoid overload.

Acceptance criteria

  • Multiple concurrent inbound requests do not block each other.
  • Throughput increases in a concurrent load test (e.g., 50–200 in‑flight requests).
  • No regression in response integrity or attestation metadata injection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions