This blog post is part of an ongoing series where we will discuss a wide range of H2-related topics.
In today's post, the second of a two-part "series within a series", we will continue our discussion regarding the challenges and importance of prioritization of streams in leveraging HTTP/2 to achieve performance improvement.
The next hurdle when designing prioritization of streams in leveraging HTTP/2 is data analysis. When we started the HTTP/2 project, there were not any web browsers available that supported prioritization. To compensate for that, we implemented three different prioritization schemes. One scheme does not take in any of the hints. Another scheme guarantees the data frame that is sent out has the highest score of all the currently queued data frames. As we found later, this operation is expensive. The cost of tracking and calculating is expensive, which cuts into any benefits prioritization might bring. That inspired us to create another prioritization scheme - the Lazy scheme. Unlike the strict prioritization scheme, the Lazy scheme does not guarantee that the data frame written has to be the highest priority in the data frames queue. It just tries its best most of the time.
The above graph shows a cumulative distribution function of those three prioritization schemes for a particular site (closer to the left is better). For this site, the Lazy implementation has an onload time under 4100 ms for 80% of the time (CDF 0.8). That is in contrast with 4500 ms and 4300 ms for no implementation and strict implementation, respectively.
This data is only of one site. And of course we chose the one with better numbers to show off. Here is the data of another real world site.
As you can see, this site shows no improvement. Generally, the improvement is somewhere between these two graphs.
As more browsers start sending out prioritization hints in their HTTP/2 requests, we can expect a long and arduous journey consisting of tweaking and re-tweaking our implementation over and over again (as one of my old managers always said, "Perfection is not attainable. But if we chase perfection, we can catch excellence.")
To learn more, go to: https://http2.akamai.com/
Additional reading on HTTP/2: