Fwd: About HTTP/2 priority

Valentin V. Bartenev vbart at nginx.com
Tue Oct 27 13:55:36 UTC 2015


On Tuesday 27 October 2015 17:33:22 Shengtuo Hu wrote:
> Hi,
> 
> I got some problems when testing priority feature in Nginx 1.9.5.
> 
> Here is the detail about my test:
> https://gist.github.com/h1994st/f21cdb7125a65c8f7182
> 
> Why are the response sequence from these two servers different?
> 
> The response sequence of nghttp server is my expected result.
> 
> Could you tell me the related part in nginx source code? I want to figure
> out this problem. It has bothered me for a long time.
> 

The response sequence exactly matches the request sequence, which isn't
surprising if we consider the sizes of files.

When NGINX receives the request for "/" (stream ID 13), there's no other
active streams at the moment, and nginx write the whole response down to
the socket.  Then nginx receives the request for "/main.css" and since
there no other active streams, nginx starts processing it.  Because the
file is also very small, the whole response is written to the socket,
again.  The same happens to other requests.  In your synthetic test case
there's just no concurrency at all, at every moment from the server point
of view there's either one or zero active streams.

I'd suggest you to do a real benchmark with real website over real
network (or at least emulate it using netem).  I did, and found that
nginx is the fastest HTTP/2 webserver at the moment in terms of first
painting and page load times.

  wbr, Valentin V. Bartenev



More information about the nginx mailing list