go
go copied to clipboard
net/http: read: connection reset by peer under high load
What version of Go are you using (go version
)?
go1.8.3
What operating system and processor architecture are you using (go env
)?
GOARCH="amd64" GOOS="linux"
What did you do?
- Edit /etc/sysctl.conf and reload with
sysctl -p
. - Edit /etc/security/limits.conf.
- Execute the following server and client (on different hosts) to simulate multiple HTTP requests: Server https://play.golang.org/p/B3UCQ_4mWm Client https://play.golang.org/p/_XQRqp8K5b
What did you expect to see?
No errors at all.
What did you see instead?
Errors like the following:
Get http://<addr>:8080: read tcp [::1]:65244->[::1]:8080: read: connection reset by peer
Get http://<addr>:8080: write tcp [::1]:62575->[::1]:8080: write: broken pipe
Get http://<addr>:8080: dial tcp [::1]:8080: getsockopt: connection reset by peer
Get http://<addr>:8080: readLoopPeekFailLocked: read tcp [::1]:51466->[::1]:8080: read: connection reset by peer