We are running nginx on a debian system as our loadbalancer
nginx version: nginx/1.9.10
built with OpenSSL 1.0.2e 3 Dec 2015 (running with OpenSSL 1.0.2g 1 Mar 2016)
We had http2 activated in our server like this:
server {
listen 443 ssl http2;
....
}
All requests are proxied to our application server. We are logging the request_time
and upstream_time
from nginx.
We switched recently our iOS hybrid app from UIWebView to WKWebView in Week 13, see what happened:
The upstream_time stayed the same but our request time suddenly raised as more and more users updated their app to the new version.
Today we decided to give it a try and deactivate http2. We only removed the word "http2" from our server config:
server {
listen 443 ssl;
....
}
See what happened:
It seems http2 is not production ready. I don't know if it is server side or client side. Maybe even the request_time is not properly logged inside nginx.
Does anybody has more info about using http2 with nginx and/or WKWebView?
Research suggest there is a bug in Ubuntu/Debian nginx package which causes low http2 performance, you need to use alternative distribution/compile nginx from source code yourself (it's really easy and will take like 5 minutes of your time).
For debian you may have to replace that configuration line in that building guide with something like:
Or just use any recent guide on the internet. It must have building with OpenSSL 1.0.2h version or higher in it, or it's just not recent enough. Here is one that should do: https://ethitter.com/2016/06/nginx-openssl-1-0-2-http-2-alpn/
The average response time is expected to be bigger with HTTP/2 because it has bigger overhead due to another layer of multiplexing.
The IETF team is keeping track of client & server support here: https://github.com/http2/http2-spec/wiki/Implementations
WKWebView is not marked as supported yet. It works fine on other mobile browsers though.