Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pingora-proxy examples don't support pipelining #377

Open
kenballus opened this issue Sep 10, 2024 · 2 comments
Open

pingora-proxy examples don't support pipelining #377

kenballus opened this issue Sep 10, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@kenballus
Copy link

kenballus commented Sep 10, 2024

Describe the bug

The pingora-proxy examples don't support client-side HTTP pipelining.

Pingora info

Please include the following information about your environment:

Pingora version: e288bfe (built from source)
Rust version: cargo 1.79.0 (ffa9cf99a 2024-06-03)
Operating system version: Debian 12

Steps to reproduce

  1. Build the pingora-proxy gateway example.
  2. Test that it works:
printf 'GET / HTTP/1.1\r\nHost: one.one.one.one\r\n\r\n' \
  | ncat --no-shutdown localhost 6191 \
  | grep -oP 'HTTP/1.1 \d\d\d'
HTTP/1.1 200
  1. Test that client-side connection reuse works when requests are not pipelined:
(printf 'GET / HTTP/1.1\r\nHost: one.one.one.one\r\n\r\n'; sleep 1; printf 'GET / HTTP/1.1\r\nHost: one.one.one.one\r\n\r\n') \
  | ncat --no-shutdown localhost 6191 \
  | grep -oP 'HTTP/1.1 \d\d\d'
HTTP/1.1 200
HTTP/1.1 200
  1. Observe that connection reuse doesn't work when requests are pipelined:
printf 'GET / HTTP/1.1\r\nHost: one.one.one.one\r\n\r\nGET / HTTP/1.1\r\nHost: one.one.one.one\r\n\r\n' \
  | ncat --no-shutdown localhost 6191 \
  | grep -oP 'HTTP/1.1 \d\d\d'
HTTP/1.1 200

Expected results

I expect to get 2 responses when sending 2 pipelined requests.

Observed results

I only get 1 response.

@drcaramelsyrup drcaramelsyrup added the bug Something isn't working label Sep 13, 2024
@eaufavor
Copy link
Member

@kenballus
Copy link
Author

Note that http pipelining is not supported by major browsers. Some also believe that it does more harm than good.

Yep. For better or for worse, HTTP is filled with features that seem useless or confusing in hindsight. Some of my (least) favorites are

Here's a breakdown of how other HTTP reverse proxies handle pipelined requests:

Disallow request pipelining:

  • Pingora (of course)
  • OpenBSD relayd

Allow request pipelining, forward requests individually, then forward responses individually:

  • Akamai GHost
  • AWS CloudFront
  • Google Cloud Classic Application Load Balancer
  • Envoy
  • Microsoft IIS

Allow request pipelining, forward requests individually, then forward responses pipelined:

  • Apache httpd mod_proxy
  • Apache Traffic Server
  • AWS Elastic Load Balancer
  • Cloudflare (which was unexpected, given that pingora is a cloudflare thing)
  • Go net/http
  • H2O
  • HAProxy
  • Lighttpd
  • nghttpx
  • Nginx
  • OpenLiteSpeed
  • Pound
  • Squid
  • Varnish

In summary, request pipelining is supported in nearly all reverse proxies, but requests are always un-pipelined before forwarding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants