• Tom Bergan's avatar
    http2: replace fixedBuffer with dataBuffer · 10c134ea
    Tom Bergan authored
    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.
    
    Updates golang/go#16512
    Fixes golang/go#18509
    
    Change-Id: Ibcb18007037e82518a65848ef3baf4937955ac9d
    Reviewed-on: https://go-review.googlesource.com/37400
    Run-TryBot: Tom Bergan <tombergan@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    10c134ea
Name
Last commit
Last update
bpf Loading commit data...
context Loading commit data...
dict Loading commit data...
html Loading commit data...
http2 Loading commit data...
icmp Loading commit data...
idna Loading commit data...
internal Loading commit data...
ipv4 Loading commit data...
ipv6 Loading commit data...
lex/httplex Loading commit data...
lif Loading commit data...
nettest Loading commit data...
netutil Loading commit data...
proxy Loading commit data...
publicsuffix Loading commit data...
route Loading commit data...
trace Loading commit data...
webdav Loading commit data...
websocket Loading commit data...
xsrftoken Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
codereview.cfg Loading commit data...