• 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
..
testdata Loading commit data...
alert.go Loading commit data...
cipher_suites.go Loading commit data...
common.go Loading commit data...
conn.go Loading commit data...
conn_test.go Loading commit data...
example_test.go Loading commit data...
generate_cert.go Loading commit data...
handshake_client.go Loading commit data...
handshake_client_test.go Loading commit data...
handshake_messages.go Loading commit data...
handshake_messages_test.go Loading commit data...
handshake_server.go Loading commit data...
handshake_server_test.go Loading commit data...
handshake_test.go Loading commit data...
key_agreement.go Loading commit data...
prf.go Loading commit data...
prf_test.go Loading commit data...
ticket.go Loading commit data...
tls.go Loading commit data...
tls_test.go Loading commit data...