-
Notifications
You must be signed in to change notification settings - Fork 19k
crypto/tls: 500% increase in allocations from (*tls.Conn).Read in go 1.17 #50657
Copy link
Copy link
Closed
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.Performance
Milestone
Description
What version of Go are you using (go version)?
$ go version 1.17.3
Does this issue reproduce with the latest release?
I believe so, but have not yet confirmed.
What operating system and processor architecture are you using (go env)?
go env Output
$ go env GOARCH="amd64" GOOS="linux"
What did you do?
I'm running a service that has many http2 clients.
What did you expect to see?
Fewer allocations when reading data from established connections.
What did you see instead?
Around 20-25% of our service's total allocations at times are coming from context.WithCancel calls made by (*tls.Conn).handshakeContext.
It looks like every (*tls.Context).Read call made by http2's ReadFrame is calling c.Handshake which calls through to c.handshakeContext, which begins with a call to context.WithCancel, which allocates.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.Performance