1

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..

timbo
  • 229
  • 2
  • 4
  • 12
  • You can test performance using webpagetest.org and you might be lucky, finding a node that does http2. Have you looked at the Nginx logs to see if the page generation time is the problem? Have you tested the new server over https1.1 rather than http2? You really need to do more testing to isolate the actual problem yourself. – Tim Aug 19 '16 at 02:57
  • Yes, logging the upstream server time and it's in the order of 100-200ms (at least for a few tiles). I also reconfigured with http/1.1 but using Chrome, didn't see any difference from the client side (I'm in Aus). – timbo Aug 19 '16 at 02:59
  • Can you do a traceroute? How about trying other performance tests and posting results? – Tim Aug 19 '16 at 03:26
  • nghttp2 is a very fast http2 client, handy for benchmarks: https://nghttp2.org/ – Frederik Deweerdt Aug 20 '16 at 01:02
  • Thanks. I've been using nghttp2 now to simulate 70 concurrent requests. – timbo Aug 20 '16 at 21:36
  • 550ms connect time - is that the same as ping time? From NZ to USA a high ping time is 200ms, so 550ms sounds like it's going around the world more than once. If it's time to ping and set up a session it's not so bad. Latency clearly reduces requests per second, that's a TCP thing. – Tim Aug 20 '16 at 23:34
  • https://www.nginx.com/blog/7-tips-for-faster-http2-performance/ – dmourati Aug 20 '16 at 23:54

0 Answers0