WebPagetest Forums
TLS/HTTP/2 slower than TCP/HTTP/1.1 - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: Web Performance (/forumdisplay.php?fid=3)
+--- Forum: Discuss Test Results (/forumdisplay.php?fid=4)
+--- Thread: TLS/HTTP/2 slower than TCP/HTTP/1.1 (/showthread.php?tid=14235)



TLS/HTTP/2 slower than TCP/HTTP/1.1 - Lennie - 03-09-2016 09:16 AM

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.


RE: TLS/HTTP/2 slower than TCP/HTTP/1.1 - pmeenan - 03-10-2016 02:52 AM

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.


RE: TLS/HTTP/2 slower than TCP/HTTP/1.1 - Lennie - 03-10-2016 03:27 AM

(03-10-2016 02:52 AM)pmeenan Wrote:  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:
http://www.webpagetest.org/result/160309_61_12TH/1/details/
http://www.webpagetest.org/result/160309_25_135E/1/details/

TLS/HTTP/2
http://www.webpagetest.org/result/160309_H3_12VS/1/details/
http://www.webpagetest.org/result/160309_M4_132D/1/details/


RE: TLS/HTTP/2 slower than TCP/HTTP/1.1 - jgarza - 03-10-2016 11:40 AM

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.