• Tom Bergan's avatar
    crypto/tls: implement dynamic record sizing · ae00df12
    Tom Bergan authored
    Currently, if a client of crypto/tls (e.g., net/http, http2) calls
    tls.Conn.Write with a 33KB buffer, that ends up writing three TLS
    records: 16KB, 16KB, and 1KB. Slow clients (such as 2G phones) must
    download the first 16KB record before they can decrypt the first byte.
    To improve latency, it's better to send smaller TLS records. However,
    sending smaller records adds overhead (more overhead bytes and more
    crypto calls), which slightly hurts throughput.
    
    A simple heuristic, implemented in this change, is to send small
    records for new connections, then boost to large records after the
    first 1MB has been written on the connection.
    
    Fixes #14376
    
    Change-Id: Ice0f6279325be6775aa55351809f88e07dd700cd
    Reviewed-on: https://go-review.googlesource.com/19591
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarTom Bergan <tombergan@google.com>
    Reviewed-by: 's avatarAdam Langley <agl@golang.org>
    ae00df12
Name
Last commit
Last update
..
aes Loading commit data...
cipher Loading commit data...
des Loading commit data...
dsa Loading commit data...
ecdsa Loading commit data...
elliptic Loading commit data...
hmac Loading commit data...
md5 Loading commit data...
rand Loading commit data...
rc4 Loading commit data...
rsa Loading commit data...
sha1 Loading commit data...
sha256 Loading commit data...
sha512 Loading commit data...
subtle Loading commit data...
tls Loading commit data...
x509 Loading commit data...
crypto.go Loading commit data...