Search code examples
performanceload-balancinghttp2akamai

How to use HTTP-2 in my production setup?


I have one load balancer and 5 origin servers. For every request, Akamai hits the LB and the request is served randomly by any of the servers. Is it okay if I enable HTTP/2 in one of the origin servers? How will it impact my system? How can I measure the performance impact?

Also, does the ALPN step happen at every hop?


Solution

  • Akamai is a CDN. This means it handles all incoming traffic - likely with a server closer to the user than your origin server and then either serves cacheable assets directly, or passes non-cacheable assets back to your origin servers.

    HTTP is a hop by hop protocol (mostly - ignoring the CONNECT method for now as only used by some proxies). This means the client connects to Akamai (likely using HTTP/2) and then Akamai connects to your origin server under a separate HTTP connection (HTTP/1.1 as Akamai does not support HTTP/2 to Origin).

    So to answer your question enabling HTTP/2 on one of your origin servers will have no effect as neither clients nor Akamai will use it.

    Whether HTTP/2 to origin is needed or beneficial is debatable. The biggest gain will be over high latency connections (like the initial client to Akamai server) especially as the browser typically limits you to 6 connections per domain. For Akamai to Origin this is typically over a fast connection in comparison (even if across a long distance) and may not be limited to 6 connections.