[GH-ISSUE #1055] 服务器延迟大导致连接中断 #829

Closed
opened 2026-05-05 12:31:41 -06:00 by gitea-mirror · 7 comments
Owner

Originally created by @xuexiaokang on GitHub (Jan 20, 2019).
Original GitHub issue: https://github.com/fatedier/frp/issues/1055

What version of frp are you using (./frpc -v or ./frps -v)?
FRPS:0.23.1
FRPC:0.23.1

What operating system and processor architecture are you using (go env)?
FRPS:amd64
FRPC:mips

Configures you used:*
frps.ini:

[common]
bind_addr = 0.0.0.0
bind_port = 7000
bind_udp_port = 7001
kcp_bind_port = 7000
vhost_http_port = 8080
vhost_https_port = 1443
dashboard_addr = 0.0.0.0
dashboard_port = 1234
dashboard_user = admin
dashboard_pwd = admin
log_file = ./frps.log
log_level = info
log_max_days = 3
token = 123456
allow_ports = 2000-3000,3001,3003,4000-50000
max_pool_count = 50
max_ports_per_client = 0
subdomain_host = frp.xxx.com
tcp_mux = true

frpc.ini:

[common]
server_addr = frp.xxx.com
server_port = 7000
token = 123456
login_fail_exit = false
admin_addr = 127.0.0.1
admin_port = 7400
admin_user = admin
admin_pwd = admin
[ssh02-1]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 11111
[ssh02-2]
type = tcp
local_ip = 192.168.1.2
local_port = 22
remote_port = 11112
[web02-1]
type = http
local_ip = 127.0.0.1
local_port = 80
subdomain = xx1
[web02-2]
type = http
local_ip = 192.168.1.2
local_port = 80
subdomain = xx2

Steps to reproduce the issue:
用国外延迟比较高的VPS做服务器,国内穿透的时候很容易出现

Describe the results you received:

2019/01/20 03:26:42 [I] [service.go:206] login to server success, get run id [66716698c977f571], server udp port [7001]
2019/01/20 03:26:42 [I] [proxy_manager.go:137] [66716698c977f571] proxy added: [ssh02-1 ssh02-2 web02-1 web02-2]
2019/01/20 03:26:42 [I] [service.go:100] admin server listen on 127.0.0.1:7000
2019/01/20 03:26:42 [I] [control.go:143] [web02-2] start proxy success
2019/01/20 03:26:42 [I] [control.go:143] [ssh02-1] start proxy success
2019/01/20 03:26:42 [I] [control.go:143] [ssh02-2] start proxy success
2019/01/20 03:26:42 [I] [control.go:143] [web02-1] start proxy success
2019/01/20 03:27:21 [W] [control.go:164] start new connection to server error: connection write timeout
2019/01/20 03:27:21 [W] [control.go:164] start new connection to server error: connection write timeout
2019/01/20 03:27:22 [W] [control.go:221] write message to control connection error: connection write timeout
2019/01/20 03:27:32 [I] [service.go:118] try to reconnect to server...
2019/01/20 03:27:32 [E] [control.go:126] work connection closed, EOF
2019/01/20 03:27:32 [I] [service.go:206] login to server success, get run id [66716698c977f571], server udp port [7001]
2019/01/20 03:27:32 [I] [proxy_manager.go:137] [66716698c977f571] proxy added: [web02-1 web02-2 ssh02-1 ssh02-2]
2019/01/20 03:27:32 [I] [control.go:143] [web02-1] start proxy success
2019/01/20 03:27:32 [I] [control.go:143] [web02-2] start proxy success
2019/01/20 03:27:32 [I] [control.go:143] [ssh02-1] start proxy success
2019/01/20 03:27:32 [I] [control.go:143] [ssh02-2] start proxy success
2019/01/20 03:28:02 [E] [control.go:126] work connection closed, EOF
2019/01/20 03:28:02 [E] [control.go:126] work connection closed, EOF
2019/01/20 03:28:02 [I] [control.go:217] control writer is closing
2019/01/20 03:28:02 [I] [service.go:118] try to reconnect to server...
2019/01/20 03:28:02 [E] [control.go:126] work connection closed, EOF
2019/01/20 03:28:02 [E] [control.go:126] work connection closed, EOF
2019/01/20 03:28:02 [I] [service.go:206] login to server success, get run id [66716698c977f571], server udp port [7001]
2019/01/20 03:28:02 [I] [proxy_manager.go:137] [66716698c977f571] proxy added: [ssh02-1 ssh02-2 web02-1 web02-2]
2019/01/20 03:28:02 [I] [control.go:143] [web02-2] start proxy success
2019/01/20 03:28:02 [I] [control.go:143] [ssh02-1] start proxy success
2019/01/20 03:28:02 [I] [control.go:143] [ssh02-2] start proxy success
2019/01/20 03:28:02 [I] [control.go:143] [web02-1] start proxy success

Describe the results you expected:
由于做服务端的服务器在国外,到国内的延迟较大,超过200ms,导致经常出现断线的错误,在配置文件中有哪个参数可以设置这个超时的时间吗?实际使用中客户端到服务端延迟超过90ms就会被断开,导致穿透后打开web的页面总是会加载不完全,显示不正常。

Additional information you deem important (e.g. issue happens only occasionally):

Can you point out what caused this issue (optional)
在配置文件中有哪个参数可以设置这个超时的时间吗?想修改成延迟500ms也不断开

Originally created by @xuexiaokang on GitHub (Jan 20, 2019). Original GitHub issue: https://github.com/fatedier/frp/issues/1055 **What version of frp are you using (./frpc -v or ./frps -v)?** FRPS:0.23.1 FRPC:0.23.1 **What operating system and processor architecture are you using (`go env`)?** FRPS:amd64 FRPC:mips *Configures you used:** frps.ini: ``` [common] bind_addr = 0.0.0.0 bind_port = 7000 bind_udp_port = 7001 kcp_bind_port = 7000 vhost_http_port = 8080 vhost_https_port = 1443 dashboard_addr = 0.0.0.0 dashboard_port = 1234 dashboard_user = admin dashboard_pwd = admin log_file = ./frps.log log_level = info log_max_days = 3 token = 123456 allow_ports = 2000-3000,3001,3003,4000-50000 max_pool_count = 50 max_ports_per_client = 0 subdomain_host = frp.xxx.com tcp_mux = true ``` frpc.ini: ``` [common] server_addr = frp.xxx.com server_port = 7000 token = 123456 login_fail_exit = false admin_addr = 127.0.0.1 admin_port = 7400 admin_user = admin admin_pwd = admin [ssh02-1] type = tcp local_ip = 127.0.0.1 local_port = 22 remote_port = 11111 [ssh02-2] type = tcp local_ip = 192.168.1.2 local_port = 22 remote_port = 11112 [web02-1] type = http local_ip = 127.0.0.1 local_port = 80 subdomain = xx1 [web02-2] type = http local_ip = 192.168.1.2 local_port = 80 subdomain = xx2 ``` **Steps to reproduce the issue:** 用国外延迟比较高的VPS做服务器,国内穿透的时候很容易出现 **Describe the results you received:** ``` 2019/01/20 03:26:42 [I] [service.go:206] login to server success, get run id [66716698c977f571], server udp port [7001] 2019/01/20 03:26:42 [I] [proxy_manager.go:137] [66716698c977f571] proxy added: [ssh02-1 ssh02-2 web02-1 web02-2] 2019/01/20 03:26:42 [I] [service.go:100] admin server listen on 127.0.0.1:7000 2019/01/20 03:26:42 [I] [control.go:143] [web02-2] start proxy success 2019/01/20 03:26:42 [I] [control.go:143] [ssh02-1] start proxy success 2019/01/20 03:26:42 [I] [control.go:143] [ssh02-2] start proxy success 2019/01/20 03:26:42 [I] [control.go:143] [web02-1] start proxy success 2019/01/20 03:27:21 [W] [control.go:164] start new connection to server error: connection write timeout 2019/01/20 03:27:21 [W] [control.go:164] start new connection to server error: connection write timeout 2019/01/20 03:27:22 [W] [control.go:221] write message to control connection error: connection write timeout 2019/01/20 03:27:32 [I] [service.go:118] try to reconnect to server... 2019/01/20 03:27:32 [E] [control.go:126] work connection closed, EOF 2019/01/20 03:27:32 [I] [service.go:206] login to server success, get run id [66716698c977f571], server udp port [7001] 2019/01/20 03:27:32 [I] [proxy_manager.go:137] [66716698c977f571] proxy added: [web02-1 web02-2 ssh02-1 ssh02-2] 2019/01/20 03:27:32 [I] [control.go:143] [web02-1] start proxy success 2019/01/20 03:27:32 [I] [control.go:143] [web02-2] start proxy success 2019/01/20 03:27:32 [I] [control.go:143] [ssh02-1] start proxy success 2019/01/20 03:27:32 [I] [control.go:143] [ssh02-2] start proxy success 2019/01/20 03:28:02 [E] [control.go:126] work connection closed, EOF 2019/01/20 03:28:02 [E] [control.go:126] work connection closed, EOF 2019/01/20 03:28:02 [I] [control.go:217] control writer is closing 2019/01/20 03:28:02 [I] [service.go:118] try to reconnect to server... 2019/01/20 03:28:02 [E] [control.go:126] work connection closed, EOF 2019/01/20 03:28:02 [E] [control.go:126] work connection closed, EOF 2019/01/20 03:28:02 [I] [service.go:206] login to server success, get run id [66716698c977f571], server udp port [7001] 2019/01/20 03:28:02 [I] [proxy_manager.go:137] [66716698c977f571] proxy added: [ssh02-1 ssh02-2 web02-1 web02-2] 2019/01/20 03:28:02 [I] [control.go:143] [web02-2] start proxy success 2019/01/20 03:28:02 [I] [control.go:143] [ssh02-1] start proxy success 2019/01/20 03:28:02 [I] [control.go:143] [ssh02-2] start proxy success 2019/01/20 03:28:02 [I] [control.go:143] [web02-1] start proxy success ``` **Describe the results you expected:** 由于做服务端的服务器在国外,到国内的延迟较大,超过200ms,导致经常出现断线的错误,在配置文件中有哪个参数可以设置这个超时的时间吗?实际使用中客户端到服务端延迟超过90ms就会被断开,导致穿透后打开web的页面总是会加载不完全,显示不正常。 **Additional information you deem important (e.g. issue happens only occasionally):** **Can you point out what caused this issue (optional)** 在配置文件中有哪个参数可以设置这个超时的时间吗?想修改成延迟500ms也不断开
Author
Owner

@BingYanchi commented on GitHub (Jan 20, 2019):

如果我没有记错,在以往的issues里作者说过,frps.ini里面有设置的选项。你可以参考frps-full.ini

<!-- gh-comment-id:455845935 --> @BingYanchi commented on GitHub (Jan 20, 2019): 如果我没有记错,在以往的issues里作者说过,frps.ini里面有设置的选项。你可以参考frps-full.ini
Author
Owner

@fatedier commented on GitHub (Jan 20, 2019):

这个和延迟没有关系,和丢包有关系,丢包率太高的话,网络不稳定就会这样,改配置也没有用。

<!-- gh-comment-id:455857595 --> @fatedier commented on GitHub (Jan 20, 2019): 这个和延迟没有关系,和丢包有关系,丢包率太高的话,网络不稳定就会这样,改配置也没有用。
Author
Owner

@fatedier commented on GitHub (Jan 20, 2019):

可以尝试将 protocol 设置为 kcp,可能会有一定好转。

<!-- gh-comment-id:455857621 --> @fatedier commented on GitHub (Jan 20, 2019): 可以尝试将 protocol 设置为 kcp,可能会有一定好转。
Author
Owner

@xuexiaokang commented on GitHub (Jan 21, 2019):

FRP的流量是否会遇上被GFW阻断的情况?开启加密能防止阻断吗?

<!-- gh-comment-id:455940797 --> @xuexiaokang commented on GitHub (Jan 21, 2019): FRP的流量是否会遇上被GFW阻断的情况?开启加密能防止阻断吗?
Author
Owner

@fatedier commented on GitHub (Jan 21, 2019):

@xuexiaokang 不在本项目的讨论范围内,请自行测试。

<!-- gh-comment-id:455941759 --> @fatedier commented on GitHub (Jan 21, 2019): @xuexiaokang 不在本项目的讨论范围内,请自行测试。
Author
Owner

@xuexiaokang commented on GitHub (Jan 21, 2019):

使用kcp之后,情况依旧还是没多大改善,无奈只好将服务器改用国内的,直接把服务器域名由原先的国外IP改成了国内IP,但是发现都过了几个小时了,域名已经生效了,Dashboard也已经正常打开为国内的服务器,但是访问客户端的WEB服务依旧还是

The page you visit not found.
Sorry, the page you are looking for is currently unavailable.
Please try again later.

The server is powered by frp.

Faithfully yours, frp.

这个说明FRPC客户端没有自动更新的功能,这个如何开启让客户端自动更新到新服务器IP呢?我一直采用
server_addr = frp.xxx.com
域名的连接方式,这种情况有点像动态公网IP做FCPS的情况,这样不会自动更新,是个麻烦事,有办法解决吗

<!-- gh-comment-id:455960771 --> @xuexiaokang commented on GitHub (Jan 21, 2019): 使用kcp之后,情况依旧还是没多大改善,无奈只好将服务器改用国内的,直接把服务器域名由原先的国外IP改成了国内IP,但是发现都过了几个小时了,域名已经生效了,Dashboard也已经正常打开为国内的服务器,但是访问客户端的WEB服务依旧还是 ``` The page you visit not found. Sorry, the page you are looking for is currently unavailable. Please try again later. The server is powered by frp. Faithfully yours, frp. ``` 这个说明FRPC客户端没有自动更新的功能,这个如何开启让客户端自动更新到新服务器IP呢?我一直采用 `server_addr = frp.xxx.com` 域名的连接方式,这种情况有点像动态公网IP做FCPS的情况,这样不会自动更新,是个麻烦事,有办法解决吗
Author
Owner

@fatedier commented on GitHub (Jan 21, 2019):

此 issue 关闭。

域名会自己做解析,如果有问题请先自己在 frpc 所在机器上调试。如果确认是 bug 再另外提 issue 描述具体内容。

<!-- gh-comment-id:455962919 --> @fatedier commented on GitHub (Jan 21, 2019): 此 issue 关闭。 域名会自己做解析,如果有问题请先自己在 frpc 所在机器上调试。如果确认是 bug 再另外提 issue 描述具体内容。
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#829
No description provided.