librespeed / speedtest-go

Go backend for LibreSpeed
GNU Lesser General Public License v3.0
700 stars 152 forks source link

"Error writing back to client" #38

Closed RonRN18 closed 2 years ago

RonRN18 commented 2 years ago

Description

My speedtest server appears to work but I'm seeing errors; I'd like to understand the errors and learn if there is anything that can be improved.

Server

I have created a VM on an XCP-ng hypervisor. This VM is running Ubuntu 21.10. I have Go version go1.17.6 installed. I have created a Systemd service to start the speedtest binary file. In my settings, I have set my port to be port 80. I have set HAProxy to redirect speedtest.webbnet.org to run the speedtest.

Client

It appears to work on my Windows 11 Pro laptop with Edge, Chrome, and Firefox. I have problems with my iPhone 11 Pro Max with iOS 15.4 in both Safari and Chrome. The initial page pops up and the test gets the ping and jitter, but then fails as it is trying to do the actual speedtest.

Below is a sample of what I'm seeing in my syslog file: Feb 7 15:05:56 go speedtest[10610]: time="2022-02-07T15:05:56-08:00" level=error msg="Error writing back to client at chunk number 1: write tcp 192.168.20.82:80->192.168.20.1:1111: write: connection reset by peer" Feb 7 15:05:56 go speedtest[10610]: time="2022-02-07T15:05:56-08:00" level=error msg="Error writing back to client at chunk number 6: write tcp 192.168.20.82:80->192.168.20.1:1093: write: connection reset by peer" Feb 7 15:05:56 go speedtest[10610]: time="2022-02-07T15:05:56-08:00" level=error msg="Error writing back to client at chunk number 1: write tcp 192.168.20.82:80->192.168.20.1:1112: write: connection reset by peer"

bcookatpcsd commented 2 years ago

I have what I think is a similar issue:

2022-05-04T17:13:24.93704 user.notice: May  4 13:13:24 librespeed: time="2022-05-04T13:13:24-04:00" level=info msg="Starting backend server on :8989"
2022-05-04T17:14:47.30499 user.notice: May  4 13:14:47 librespeed: time="2022-05-04T13:14:47-04:00" level=error msg="Error writing back to client at chunk number 38: write tcp 10.20.0.6:8989->10.20.28.36:61854: write: broken pipe"
2022-05-04T17:14:47.30514 user.notice: May  4 13:14:47 librespeed: time="2022-05-04T13:14:47-04:00" level=error msg="Error writing back to client at chunk number 21: write tcp 10.20.0.6:8989->10.20.28.36:61878: write: broken pipe"
2022-05-04T17:14:47.31532 user.notice: May  4 13:14:47 librespeed: time="2022-05-04T13:14:47-04:00" level=error msg="Error writing back to client at chunk number 8: write tcp 10.20.0.6:8989->10.20.28.36:61880: write: broken pipe"
2022-05-04T17:14:47.32333 user.notice: May  4 13:14:47 librespeed: time="2022-05-04T13:14:47-04:00" level=error msg="Error writing back to client at chunk number 13: write tcp 10.20.0.6:8989->10.20.28.36:61879: write: broken pipe"
2022-05-04T17:14:47.32932 user.notice: May  4 13:14:47 librespeed: time="2022-05-04T13:14:47-04:00" level=error msg="Error writing back to client at chunk number 99: write tcp 10.20.0.6:8989->10.20.28.36:61881: write: broken pipe"

compiled by hand go 18.1

blu006 commented 2 years ago

I am also having similar issues with the version tagged as v1.1.4.

maddie commented 2 years ago

This is not application related in most cases. The connection reset by peer and broken pipe errors are mostly caused by the other side closing the connection prematurely.