Measurements have shown HttpClient GET requests have a very poor scalability (HTTP/2 protocol, Plain connection).
Comments
Source of such bad scalability is the fact that HttpClient code is highly synchronized.
One of the major blocking contributors is "Http2Connection.sendlock":
- it's a single lock for entire Http2Connection
- it provides proper synchronization for:
-- stream numbering
-- HPACK encoder (should be serial by HTTP/2 spec)
-- frames order
Distribution of blocked state (by amount of blocking):
case 1 byte trasnfer:
55.7% -- "Http2Connection.sendlock" caused by sendWindowUpdate
37.1% -- "Http2Connection.sendlock" caused by sendHeaders
2.4% -- blocked in "Stream.inputQ.take()" ("receiveData")
case 10^6 bytes trasnfer:
17.5% -- "Http2Connection.sendlock" caused by sendWindowUpdate
0.31% -- "Http2Connection.sendlock" caused by sendHeaders
80.2% -- blocked in "Stream.inputQ.take()" ("receiveData")
07-07-2016
Attached charts shows how the scaling is bad.
Measured on 24x2 cores IvyBridge. Two cases: GET 1 byte data and get 1Mb.