I was asked to setup a newer, optimised tile server that provides tiles over HTTPS (Google has disabled some map APIs when the page is not HTTPS) and it seemed to be the right thing to do to also use HTTP2.
The existing server was Apache 2.4.7 with mod_python running TileStache (a Python app) to serve tiles. The new server is Nginx 1.11.3 configured with SSL and HTTP2, and using uwsgi 2.0.12 to run TileStache with the same TileStache configuration.
However the client has reported that the performance of the new server in Australia is slower than that of the existing server.
In testing a tile load performance locally using Apache ab, both the existing server and new server are located in the US and from a seperate server in the same infrastructure, the existing Apache server provides individual tiles at an average of 131ms over three requests. The new Nginx server provides individual tiles at an average of 115ms over three requests.
From a 14.04 Ubuntu machine connected to the Australian high-speed NBN (National Broadband network) at 100Mbit/s, the same ab -n 3 request to the existing server produces an average 867ms. But the new server returns tiles at an average of 1562ms.
The client has reported similar 1-2 second responses on an ADSL connection in Australia but figures from the Chrome dev tools rather than an ab test.
What would cause HTTPS over HTTP2 to degrade compared to HTTP?
Update
I've configured nginx to log the request protocol and ab seems to actually making requests with HTTP/1.0. So rethinking which test client to use.
I have setup h2load to use http2 to perform 70 concurrent requests with:
h2load -t2 -c 70 -n 70 -i urls
.
On a server in the same infrastructure, I see:
min max mean sd +/- sd time for request: 2.62ms 15.40ms 7.11ms 3.12ms 72.86% time for connect: 14.94ms 68.85ms 44.32ms 17.95ms 52.86% time to 1st byte: 20.90ms 71.60ms 51.43ms 16.79ms 50.00% req/s : 13.95 47.65 22.20 8.99 85.71%
On a NBN-connected Ubuntu machine, I see:
min max mean sd +/- sd time for request: 556.58ms 599.88ms 578.16ms 8.85ms 68.57% time for connect: 840.90ms 926.45ms 886.62ms 21.09ms 61.43% time to 1st byte: 1.40s 1.53s 1.46s 29.87ms 61.43% req/s : 0.66 0.72 0.68 0.01 61.43%
So, 1.5 seconds on average before seeing first byte..
0 Answers