go icon indicating copy to clipboard operation
go copied to clipboard

net/http: read: connection reset by peer under high load

Open liranp opened this issue 7 years ago • 20 comments

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?

  1. Edit /etc/sysctl.conf and reload with sysctl -p.
  2. Edit /etc/security/limits.conf.
  3. 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

liranp avatar Jul 09 '17 15:07 liranp