JDK-8159755 : HttpClient GET requests have a very poor scalability (HTTP/2, plain)
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2016-06-17
  • Updated: 2016-12-12
  • Resolved: 2016-12-12
Related Reports
Blocks :  
Duplicate :  
Relates :  
Description
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.
17-06-2016