Loading...
FinchTrade

Definition

Pipelining Requests

How HTTP/1.1 overlaps requests on one connection, why responses remain ordered, and what limits latency gains and safe retries.

Pipelining Requests is an HTTP/1.1 technique in which a client sends additional requests on one persistent TCP connection—a connection kept open for reuse—before earlier responses arrive. Responses must be sent in request-receipt order. A server may process the requests in parallel if all use safe methods, meaning they request essentially read-only behavior; parallel execution is not guaranteed.

How Request Pipelining Works

With sequential reuse, the client sends A, receives A’s response, then sends B. Pipelining Requests changes this to sending A, B and C without those intervening waits, then receiving responses A, B and C. It uses neither another TCP connection nor a special enable-pipelining header.

HTTP/1.1 connections are persistent by default, but reuse does not require pipelining. Reuse requires message lengths that do not depend on closing the connection. Servers must read each complete request body or close after responding; clients must consume complete response bodies to reuse the connection. The close signal is the close option in the Connection header (Connection: close); it announces closure after the current response. Sending or receiving this option ends permission to send additional requests, as does receiving an HTTP/1.0 response without keep-alive.

HTTP/1.1 has no request identifier for matching responses. The client tracks outstanding requests in send order, assigning each response to the first request still awaiting a final response. Informational 1xx responses belong to that request; only a final response advances matching. Ordered delivery does not imply serial server execution.

HTTP pipelining vs. sequential requests

CriteriaPipelining requestsSequential (non-pipelined) requests
LatencyPipelining requestsSends ready requests without intervening response waits; latency gains are conditional.Sequential (non-pipelined) requestsWaits for each response before sending the next request on the same persistent connection.
RecoveryPipelining requestsA connection failure can leave several sent requests unanswered; retry safety rules apply.Sequential (non-pipelined) requestsA connection failure leaves at most one sent request without a complete response; retry safety rules still apply.
Both columns assume one persistent HTTP/1.1 connection; opening a new connection for every request is not the alternative shown.

Latency and Head-of-Line Blocking

Consider a hypothetical case with three independent, ready GET requests to retrieve resources on an established connection. Assume a 100 ms network round-trip time, negligible server processing and message transmission time, no loss and no other bottleneck. Sequential requests take approximately 3 × 100 = 300 ms; pipelined requests take approximately 1 × 100 = 100 ms. Pipelining Requests removes two intervening waits under these assumptions; this is not a benchmark or guaranteed speedup.

Pipelining Requests does not remove head-of-line blocking: later responses must wait behind an earlier response that is slow to produce or large to transfer. Even if the server finishes later work first, it cannot send that response ahead of the earlier one.

Looking for liquidity, exploring on-ramp/off-ramp services, or seeking expert guidance?

Connection Failures and Safe Recovery

Safe methods such as GET can still have incidental side effects; safety describes what the client requests. For recovery, the relevant property is idempotence: repeating a request has the same intended server effect as sending it once, though responses may differ. This permits automatic repetition after a communication failure. Safe methods are idempotent, but so are state-changing methods such as PUT and DELETE.

An unanswered request might already have been applied. Clients should retry unanswered requests after closure subject to retry-safety rules. A client should not automatically retry a non-idempotent method unless it knows the request’s actual semantics are idempotent or can detect that the original was never applied. It should not automatically retry a failed automatic retry.

A client should not pipeline further requests after a non-idempotent method until it receives that method’s final response status, unless it can detect and recover from partial failure of the sequence.

When retrying pipelined requests after a failed connection—one the server did not explicitly close in its last complete response—the client must not pipeline immediately after re-establishing the connection. One recovery example is to send the first remaining request alone, read its response, and only then consider another pipeline if the connection remains reusable. That request might produce an error response followed by premature closure. Additional requests reaching the closed connection can trigger a TCP reset before the client reads that response, losing the error again. Receiving an explicit Connection: close instead requires the client to stop sending and close after reading that response; already-sent later requests are not guaranteed processing.

An intermediary, such as a proxy forwarding requests, may forward a pipeline but need not preserve pipelining. If its server-facing connection fails before a response arrives, it may retry an unanswered sequence only if all requests have idempotent methods. Otherwise, it should forward received responses and close the client-facing connections for client recovery. A proxy must not automatically retry non-idempotent requests.

How HTTP/2 Differs

  • Response Association: HTTP/1.1 pipelining matches responses by request order. HTTP/2 assigns each request/response exchange its own stream, an identified logical channel within the connection.
  • Progress: HTTP/2 interleaves frames, the pieces of messages carried on the connection, so a stalled exchange need not prevent other streams from progressing. This avoids HTTP/1.1’s response-order bottleneck.
  • Transport Limits: HTTP/2 streams share one TCP connection. A lost or reordered packet can stall all active transactions during TCP’s loss recovery, including transactions not directly affected by that packet. This is TCP-level head-of-line blocking, distinct from HTTP/1.1’s ordered responses.

The historical Chromium design record reports removal of Chrome’s pipelining option and inconsistent pipelining behavior among servers and middleboxes, the network intermediaries between endpoints.

Power your growth with seamless crypto liquidity

A single gateway to liquidity with competitive prices, fast settlements, and lightning-fast issue resolution

Get started