mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #4801] 客户端频繁断链以及数据发送拥挤堵塞 #3792
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#3792
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @yongchengfan on GitHub (May 20, 2025).
Original GitHub issue: https://github.com/fatedier/frp/issues/4801
Bug Description
使用frp stcp进行端对端组网连接,然后进行tcp 连接互发数据,期间出现较为频繁的断链重连 以及数据堵塞情况
(会出现频繁的重连,到时没有太大的影响,就是会出现数据突然消息)
连接的中断在不到20分钟内重连次数非常多
下面是数据拥挤堵塞的问题:使用stcp 模式下进行tcp 数据连接 ,进行数据收发通信
[2025-05-20 17:11:01.844]# RECV ASCII/93 from SERVER <<<
服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!
[2025-05-20 17:11:02.345]# RECV ASCII/93 from SERVER <<<
服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!
[2025-05-20 17:11:03.174]# RECV ASCII/93 from SERVER <<<
服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!
[2025-05-20 17:11:03.496]# RECV ASCII/93 from SERVER <<<
服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!
[2025-05-20 17:11:18.638]# RECV ASCII/93 from SERVER <<<
服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!
[2025-05-20 17:11:19.095]# RECV ASCII/2790 from SERVER <<<
服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!
[2025-05-20 17:11:19.697]# RECV ASCII/93 from SERVER <<<
服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!
[2025-05-20 17:11:20.624]# RECV ASCII/186 from SERVER <<<
服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!
[2025-05-20 17:11:20.855]# RECV ASCII/93 from SERVER <<<
服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!
[2025-05-20 17:11:21.359]# RECV ASCII/93 from SERVER <<<
服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!
[2025-05-20 17:11:21.845]# RECV ASCII/93 from SERVER <<<
服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!
[2025-05-20 17:11:22.350]# RECV ASCII/93 from SERVER <<<
服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!
[2025-05-20 17:11:22.849]# RECV ASCII/93 from SERVER <<<
服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!
[2025-05-20 17:11:23.359]# RECV ASCII/93 from SERVER <<<
服务端测试通信数据测试!
@!!!!!!!!!!!!!!!!!!
上面这个情况是在通信过程中会突然出现的,先是正常的数据收发,然后就突然收不到消息,之后出现一大段数据,最后又是正常的,这样循环往复,频繁出现
frpc Version
0.62.1
frps Version
0.62.1
System Architecture
frpc- linux/arm64 frps -linux/x86
Configurations
frps.toml :
root@hcss-ecs-2bbc:~/frp/frp_0.62.1_linux_amd64# cat frps.toml
核心配置
bindAddr = "0.0.0.0"
bindPort = 7000
kcpBindPort = 7001
quicBindPort = 7002
maxPortsPerClient = 50
udpPacketSize = 8192
userConnTimeout = 30
控制面板
[webServer]
addr = "0.0.0.0"
port = 7500
user = "geniousfan"
password = "cheng13579"
日志
[log]
to = "console" # 暂时输出到控制台便于调试
level = "info" # 保持信息日志用于排查
maxDays = 7
网络层优化(关键调整)
[transport]
maxPoolCount = 20
heartbeatTimeout = 180 # 延长心跳超时
tcpKeepalive = 45 # 缩短 TCP Keepalive 间隔
tcpMux = true
tcpMuxKeepaliveInterval = 30
[transport.quic]
keepalivePeriod = 15
maxIdleTimeout = 60
maxIncomingStreams = 50000
端口范围
allowPorts
start = 30000
end = 70000
frpc,toml : (proxies)
通用配置
serverAddr = "xx.xx.xxx.xx"
serverPort = 7000
udpPacketSize = 8192
user = "proxy01"
[log]
#to = "./frpc.log"
level = "info"
maxDays = 7
网络层优化(关键调整)
[transport]
protocol = "tcp" # 强制使用 TCP
dialServerTimeout = 30
dialServerKeepalive = 45 # 与服务端一致
poolCount = 15
tcpMux = true
heartbeatInterval = 30 # 启用独立心跳
heartbeatTimeout = 180 # 与服务端一致
tcpMuxKeepaliveInterval = 0 # 关闭 tcp_mux 保活
STCP 代理配置
proxies
name = "dou_stcp_fallback"
type = "stcp"
secretKey = "dm9832"
localIp = "127.0.0.1"
localPort = 8520
[proxies.transport]
useEncryption = false
useCompression = false
bandwidthLimit = "10MB"
bandwidthLimitMode = "client"
frpc.toml : (visitors)
通用配置
serverAddr = "xxx.xx.xx.xx"
serverPort = 7000
udpPacketSize = 8192 # 与代理端完全一致(原4096有误)
user = "proxy01" # 必须与代理端的 user 完全一致
日志配置
[log]
level = "info"
maxDays = 7
网络层参数对齐(关键优化)
[transport]
protocol = "tcp" # 保持与代理端相同传输协议
dialServerTimeout = 30 # 增加超时时间(原15秒过短)
dialServerKeepalive = 45 # 与代理端和服务端一致
poolCount = 15 # 增加连接池大小
tcpMux = true
heartbeatInterval = 30 # 启用独立心跳(与代理端一致)
heartbeatTimeout = 180 # 与代理端和服务端一致
tcpMuxKeepaliveInterval = 0 # 关闭tcp_mux保活(避免冲突)
STCP访问通道配置(关键调整)
visitors
name = "dou_stcp_visitor" # 建议使用与代理端对应的名称
type = "stcp"
serverName = "dou_stcp_fallback" # 格式:{user}.{proxyName}
secretKey = "dm9832" # 与代理端一致
bindAddr = "127.0.0.1" # 本地监听地址(仅127.0.0.1)
bindPort = 8763 # 本地监听端口(需实际可用)
传输优化(与代理端完全对齐)
[visitors.transport]
useEncryption = false
useCompression = false
Logs
[root@HTNICE frp]# ./frpc -c frpc.toml
2025-05-20 17:18:39.173 [I] [sub/root.go:149] start frpc service for config file [frpc.toml]
2025-05-20 17:18:39.173 [I] [client/service.go:314] try to connect to server...
2025-05-20 17:18:41.442 [I] [client/service.go:306] [b11c681821c22efd] login to server success, get run id [b11c681821c22efd]
2025-05-20 17:18:41.445 [I] [proxy/proxy_manager.go:177] [b11c681821c22efd] prox y added: [proxy01.dou_stcp_fallback]
2025-05-20 17:18:41.655 [I] [client/control.go:172] [b11c681821c22efd] [proxy01. dou_stcp_fallback] start proxy success
2025-05-20 17:19:20.605 [I] [client/service.go:314] [b11c681821c22efd] try to co nnect to server...
2025-05-20 17:19:20.606 [W] [client/service.go:317] [b11c681821c22efd] connect t o server error: dial tcp 124.71.38.37:7000: connect: network is unreachable
2025-05-20 17:19:22.706 [I] [client/service.go:314] [b11c681821c22efd] try to co nnect to server...
2025-05-20 17:19:22.923 [I] [client/service.go:306] [b11c681821c22efd] login to server success, get run id [b11c681821c22efd]
2025-05-20 17:19:22.924 [I] [proxy/proxy_manager.go:177] [b11c681821c22efd] prox y added: [proxy01.dou_stcp_fallback]
2025-05-20 17:19:22.967 [I] [client/control.go:172] [b11c681821c22efd] [proxy01. dou_stcp_fallback] start proxy success
2025-05-20 17:22:03.416 [I] [client/service.go:314] [b11c681821c22efd] try to co nnect to server...
2025-05-20 17:22:03.417 [W] [client/service.go:317] [b11c681821c22efd] connect t o server error: dial tcp 124.71.38.37:7000: connect: network is unreachable
2025-05-20 17:22:05.507 [I] [client/service.go:314] [b11c681821c22efd] try to co nnect to server...
2025-05-20 17:22:05.508 [W] [client/service.go:317] [b11c681821c22efd] connect t o server error: dial tcp 124.71.38.37:7000: connect: network is unreachable
2025-05-20 17:22:10.062 [I] [client/service.go:314] [b11c681821c22efd] try to co nnect to server...
2025-05-20 17:22:10.294 [I] [client/service.go:306] [b11c681821c22efd] login to server success, get run id [b11c681821c22efd]
2025-05-20 17:22:10.297 [I] [proxy/proxy_manager.go:177] [b11c681821c22efd] prox y added: [proxy01.dou_stcp_fallback]
2025-05-20 17:22:10.347 [I] [client/control.go:172] [b11c681821c22efd] [proxy01. dou_stcp_fallback] start proxy success
2025-05-20 17:24:50.682 [I] [client/service.go:314] [b11c681821c22efd] try to co nnect to server...
2025-05-20 17:24:50.915 [I] [client/service.go:306] [b11c681821c22efd] login to server success, get run id [b11c681821c22efd]
2025-05-20 17:24:50.916 [I] [proxy/proxy_manager.go:177] [b11c681821c22efd] prox y added: [proxy01.dou_stcp_fallback]
2025-05-20 17:24:51.012 [I] [client/control.go:172] [b11c681821c22efd] [proxy01. dou_stcp_fallback] start proxy success
Steps to reproduce
...
Affected area
@yongchengfan commented on GitHub (May 21, 2025):
@yongchengfan commented on GitHub (May 21, 2025):
https://github.com/fatedier/frp/issues/4061
这个帖子同样的问题,通过同一网络下不同设备去ping 这个公网ip,发现是出现问题的设备 存在间歇性网络故障
[root@HTNICE ~]# ping 124.71.38.37
PING 124.71.38.37 (124.71.38.37): 56 data bytes
64 bytes from 124.71.38.37: seq=0 ttl=50 time=355.753 ms
64 bytes from 124.71.38.37: seq=1 ttl=50 time=441.722 ms
64 bytes from 124.71.38.37: seq=2 ttl=50 time=114.703 ms
64 bytes from 124.71.38.37: seq=3 ttl=50 time=38.812 ms
64 bytes from 124.71.38.37: seq=4 ttl=50 time=642.092 ms
64 bytes from 124.71.38.37: seq=5 ttl=50 time=807.092 ms
64 bytes from 124.71.38.37: seq=6 ttl=50 time=194.990 ms
64 bytes from 124.71.38.37: seq=7 ttl=50 time=44.397 ms
64 bytes from 124.71.38.37: seq=8 ttl=50 time=38.808 ms
64 bytes from 124.71.38.37: seq=9 ttl=50 time=69.228 ms
64 bytes from 124.71.38.37: seq=10 ttl=50 time=38.675 ms
64 bytes from 124.71.38.37: seq=11 ttl=50 time=44.359 ms
64 bytes from 124.71.38.37: seq=12 ttl=50 time=39.208 ms
64 bytes from 124.71.38.37: seq=13 ttl=50 time=38.861 ms
64 bytes from 124.71.38.37: seq=14 ttl=50 time=41.986 ms
64 bytes from 124.71.38.37: seq=15 ttl=50 time=39.414 ms
64 bytes from 124.71.38.37: seq=16 ttl=50 time=41.195 ms
64 bytes from 124.71.38.37: seq=17 ttl=50 time=38.866 ms
64 bytes from 124.71.38.37: seq=18 ttl=50 time=39.385 ms
64 bytes from 124.71.38.37: seq=19 ttl=50 time=42.033 ms
64 bytes from 124.71.38.37: seq=20 ttl=50 time=39.216 ms
64 bytes from 124.71.38.37: seq=21 ttl=50 time=40.658 ms
64 bytes from 124.71.38.37: seq=22 ttl=50 time=38.937 ms
64 bytes from 124.71.38.37: seq=23 ttl=50 time=41.993 ms
64 bytes from 124.71.38.37: seq=24 ttl=50 time=38.675 ms
64 bytes from 124.71.38.37: seq=25 ttl=50 time=41.315 ms
64 bytes from 124.71.38.37: seq=26 ttl=50 time=38.624 ms
64 bytes from 124.71.38.37: seq=27 ttl=50 time=38.817 ms
ping: sendto: Network is unreachable
后续解决:换设备
@zeroasuka commented on GitHub (Jul 9, 2025):
我嘗試將frps降到0.51.3 frpc維持在0.63 就不會出現頻繁斷線重連