-1

I have been working towards switching the communication protocol for our application from HTTP/1.1 to HTTP/2.

The communication flow is some thing like this:

  1. Client talks to an Amazon Application load balancer over HTTP/2
  2. Application load balancer talks to a reverse proxy (HAProxy) over HTTP/1.1
  3. Reverse proxy then talks to the webserver over HTTP/1.1

I wanted all of this to be HTTP/2 but due to a limitation of the load balancer (https://forums.aws.amazon.com/thread.jspa?threadID=332847) the communication between it and the reverse proxy can either be HTTP/2 or HTTP/1.1 but not both. I need to support both because there is a WebSocket connection that is opened over HTTP/1.1.

I have an option to make the communication between HAProxy and the Webserver to be HTTP/2 as our Webserver support it.

So the flow becomes:

  1. Client -> ALB (HTTP/2)
  2. ALB -> HAProxy (HTTP/1.1)
  3. HAProxy -> Webserver (HTTP/2)

I wanted to understand two things

  1. If this is possible with HAProxy?
  2. If this is a good move? will this give me any performance improvements?

Thanks in advance! Cheers

  • [What topics can I ask about here?](https://stackoverflow.com/help/on-topic) and [ask] – Rob Oct 17 '21 at 00:09

1 Answers1

0

Technically Ha Proxy can do HTTP / 2.0 end to end (version like 2.0 or newer https://www.haproxy.com/fr/blog/haproxy-2-0-and-beyond/#end-to-end-http-2)

And in 2.4 you can do HTTP/2 WebSockets (https://www.haproxy.com/fr/blog/announcing-haproxy-2-4/)

My first thought about HTTP/2.0 for multiplexing is interesting to reduce latency. Latency which is usually between the client and your fisrt instance (here ALB). I don't know if you have latencies between HaProxy -> Webserver but if you think you have it. This brings a nice performance increase between HAProxy and your backend servers, since it condenses multiple connections down to a single connection. Otherwise do not expect a big improvement. Moreover it could depend if you use TLS between Haproxy and webservers.

But options like headers compression and persistent TCP Connections are interesting so this makes sense to use it.

antoninG
  • 21
  • 4