TLS/HTTP/2 slower than TCP/HTTP/1.1

Hi folks,

Have to say I’m a bit surprised to see when you have a site with a lot of requests HTTP/1.1 is still faster than HTTP/2 (obviously with HTTPS):

HTTP:
http://www.webpagetest.org/result/160308_E6_1HPW/1/details/

HTTP/2 (HTTPS/TLS):
http://www.webpagetest.org/result/160308_VG_1GNQ/1/details/

For example take the same request for an image:

  • request 25 on the first page (HTTP)
  • request 19 on the second page (HTTP/2).

Almost seems like it’s the overhead of encrypting the files ?

Because it’s the same H2O webserver talking to Varnish with all files cached.

Is this normal / to be expected ?

I would love to get the opinion of someone else on this.

Have a good day.

Try running ~9 tests and preferably from the “Dulles Thinkpad” test location. It’s really hard to say with one sample and the Amsterdam server looks like it is seriously CPU constrained loading the page.

There’s a good chunk of time when loading the page where the network is idle and it looks like it’s entirely JS-bound. Looking at the bandwidth charts, the H2 one looks like it more cleanly and consistently fills the connection so I’d be more inclined to think that it might be from something else.

Thank you very much, will do that.

I’ve also been looking into it and fix some minor things.

These ones already look a lot more like what you’d expect:

TCP/HTTP/1.1:

TLS/HTTP/2

Lennie, a few of my colleagues where talking about this topic today. A possible reason of why h2 is slower than h1 could be a small initial TCP congestion window.

I am not sure how the WPT servers have the TCP parameters configured in the kernel, but a small congestion window will favor h1 which opens 6-8 TCP connections vs h2 which opens only 1.