NPN:Next Protocol Negotiation,是由Google公司開發的用於SPDY進行協議協商擴展。
協商過程:chrome
ALPN:Application Layer Protocol Negotiation,是IETF制定的在HTTP/2.0中使用的協議協商擴展
協商過程:多線程
目前國內大多數網站還不支持http/2,http/2尚未大規模的使用起來,相關客戶端和組件還不完善,還存在一些問題,只作了簡單的一個測試:
5000次訪問數據、單線程、異步方式異步
http:5條長鏈接 1568ms性能
https:5條長鏈接 2284ms測試
http2:1條鏈接 2083ms網站
5000次訪問數據、單線程、異步方式加密
http:5條長鏈接 1478msspa
https:5條長鏈接 2057msfirefox
http2:5條鏈接 2008ms線程
5000次訪問數據、單線程、同步方式
http:1條長鏈接 1992ms
https:1條長鏈接 2884ms
http2:1條鏈接 2879ms
5000次訪問數據、多線程、異步方式
http:5條長鏈接 1474ms
https:5條長鏈接 1956ms
Http2:5條鏈接 2041ms
5000次訪問數據、多線程、同步方式
http:5條長鏈接 1053ms
https:5條長鏈接 1578ms
http2:5條鏈接 1742ms