http2: replace fixedBuffer with dataBuffer
fixedBuffer was a bad idea for two reasons:
1. It was fixed at a constant 64KB (the current default flow-control
window) which wastes memory on the server when clients upload many
small request bodies.
2. A follow-up CL will allow configuring the server's connection and
stream receive windows. We want to allow individual streams to use
varying amounts of the available connection window. This is not
possible when each stream uses a fixedBuffer.
dataBuffer grows and shrinks based on current usage. The worst-case
fragmentation of dataBuffer is 32KB wasted memory per stream, but I
expect that worst-case will be rare. In particular, if the declared
size of a stream's request body is under 1KB, then the server will not
allocate more than 1KB to process that stream's request body.
Run-TryBot: Tom Bergan <email@example.com>
TryBot-Result: Gobot Gobot <firstname.lastname@example.org>
Reviewed-by: Brad Fitzpatrick <email@example.com>
6 files changed