HTTP/2 performance comparison (case study)

nginx-config

Couple of days ago nginx released nginx-1.10.0 stable version with http2 support.
I was already running nginx from their repos on couple of servers, and as the upgrade was possible just by running apt-get upgrade and adding a single parameter to config file, I decided to give it a try immediately.

I knew http2 use should impact sites with lots of http requests the most, so I compared the results from my hobby site for Latvian gamers – https://exs.lv/ – which has quite a lot of small images and other assets. I removed 3rd party ads so they don’t impact the load times and run couple of tests using gtmetrix.com. The results were pretty impressive for changing a single line of code.

I ran gtmetrix 5 times with http2 enabled, and 5 times without it (with the same nginx version in both cases). There were 101 http requests each run.

Load times without http/2

run 1 8.0s
run 2 5.2s
run 3 12.7s
run 4 7.6s
run 5 5.1s
Average 7.72s

Load times with http/2 enabled

run 1 4.8s
run 2 4.5s
run 3 4.7s
run 4 4.7s
run 5 3.7s
Average 4.48s

 

Example from waterfall view without http/2
Example from waterfall view without http/2
Waterfall view with http/2 enabled
Waterfall view with http/2 enabled

Leave a Reply

Your email address will not be published. Required fields are marked *