[GH-ISSUE #1685] 直接连接服务器和通过frp中转后测速结果差异很大 #1333

Closed
opened 2026-05-05 12:50:56 -06:00 by gitea-mirror · 6 comments
Owner

Originally created by @haojie06 on GitHub (Mar 5, 2020).
Original GitHub issue: https://github.com/fatedier/frp/issues/1685

Issue is only used for submiting bug report and documents typo. If there are same issues or answers can be found in documents, we will close it directly.
(为了节约时间,提高处理问题的效率,不按照格式填写的 issue 将会直接关闭。)
(请不要在 issue 评论中出现无意义的 加1我也是 等内容,将会被直接删除。)
(由于个人精力有限,和系统环境,网络环境等相关的求助问题请转至其他论坛或社交平台。)

Use the commands below to provide key information from your environment:
You do NOT have to include this information if this is a FEATURE REQUEST

What version of frp are you using (./frpc -v or ./frps -v)?
0.31.2
What operating system and processor architecture are you using (go env)?
客户端和服务端都是ubuntu1804
Configures you used:

[iperf3]
type = tcp
local_ip = 127.0.0.1
local_port = 5201
remote_port = 5202

在有公网ip的服务器上开启了iperf3服务使用端口5201
又中转了无公网的一台机器的iperf3端口到有公网的服务器上(5202),分别进行了两次测试

Steps to reproduce the issue:

  1. 在无公网ip的服务器上使用iperf3 -c 有公网的服务器ip -t 20 -i 2
  2. 在有公网ip的服务器上使用iperf3 -c 127.0.0.1 -t 20 -i 2 -p 5201(中转后的无公网机器的iperf3端口) -R
    发现速度相差很大。
    截图如下
    Describe the results you received:
    图一是 在无公网ip的机器上使用iperf3 连接 有公网ip的机器5201端口
    image.png

图二是在有公网ip的机器上使用iperf3连接本地的5202端口(中转)
image.png

Describe the results you expected:
经过多次测试,中转后再测速总比直接连接时要慢一些,请问为什么会出现这种情况呢

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

Can you point out what caused this issue (optional)

Originally created by @haojie06 on GitHub (Mar 5, 2020). Original GitHub issue: https://github.com/fatedier/frp/issues/1685 Issue is only used for submiting bug report and documents typo. If there are same issues or answers can be found in documents, we will close it directly. (为了节约时间,提高处理问题的效率,不按照格式填写的 issue 将会直接关闭。) (请不要在 issue 评论中出现无意义的 **加1**,**我也是** 等内容,将会被直接删除。) (由于个人精力有限,和系统环境,网络环境等相关的求助问题请转至其他论坛或社交平台。) Use the commands below to provide key information from your environment: You do NOT have to include this information if this is a FEATURE REQUEST **What version of frp are you using (./frpc -v or ./frps -v)?** 0.31.2 **What operating system and processor architecture are you using (`go env`)?** 客户端和服务端都是ubuntu1804 **Configures you used:** ``` [iperf3] type = tcp local_ip = 127.0.0.1 local_port = 5201 remote_port = 5202 ``` 在有公网ip的服务器上开启了iperf3服务使用端口5201 又中转了无公网的一台机器的iperf3端口到有公网的服务器上(5202),分别进行了两次测试 **Steps to reproduce the issue:** 1. 在无公网ip的服务器上使用iperf3 -c 有公网的服务器ip -t 20 -i 2 2. 在有公网ip的服务器上使用iperf3 -c 127.0.0.1 -t 20 -i 2 -p 5201(中转后的无公网机器的iperf3端口) -R 发现速度相差很大。 截图如下 **Describe the results you received:** 图一是 在无公网ip的机器上使用iperf3 连接 有公网ip的机器5201端口 ![image.png](https://i.loli.net/2020/03/06/84flILR7uZgQHDj.png) 图二是在有公网ip的机器上使用iperf3连接本地的5202端口(中转) ![image.png](https://i.loli.net/2020/03/06/7gcwHbD6fOsnh5o.png) **Describe the results you expected:** 经过多次测试,中转后再测速总比直接连接时要慢一些,请问为什么会出现这种情况呢 **Additional information you deem important (e.g. issue happens only occasionally):** **Can you point out what caused this issue (optional)**
Author
Owner

@fatedier commented on GitHub (Mar 6, 2020):

这两次的上行和下行不一样吧,尽量用一致的方式测试。另外中转服务是有一些额外处理的,所以带宽下降是正常的。

<!-- gh-comment-id:595576421 --> @fatedier commented on GitHub (Mar 6, 2020): 这两次的上行和下行不一样吧,尽量用一致的方式测试。另外中转服务是有一些额外处理的,所以带宽下降是正常的。
Author
Owner

@haojie06 commented on GitHub (Mar 6, 2020):

这两次都是无公网ip的服务器上传到有公网ip的服务器的测速

<!-- gh-comment-id:595630848 --> @haojie06 commented on GitHub (Mar 6, 2020): 这两次都是无公网ip的服务器上传到有公网ip的服务器的测速
Author
Owner

@CxZMoE commented on GitHub (Mar 9, 2020):

这两次都是无公网ip的服务器上传到有公网ip的服务器的测速

这要看你内网机器的上行带宽是多少

<!-- gh-comment-id:596518855 --> @CxZMoE commented on GitHub (Mar 9, 2020): > 这两次都是无公网ip的服务器上传到有公网ip的服务器的测速 这要看你内网机器的上行带宽是多少
Author
Owner

@Ovear commented on GitHub (Mar 10, 2020):

的确有这种情况发生,我这边也能复现吞吐率从100Mbps下降到20Mbps左右,ws+tls或者tcp+encrypt都是类似的行为,不过还没有仔细研究。
不过我的环境是两边都是公网的情况下,仅把frp当做隧道使用,测试也是通过这两台机器上用iperf做的。

<!-- gh-comment-id:596957874 --> @Ovear commented on GitHub (Mar 10, 2020): 的确有这种情况发生,我这边也能复现吞吐率从100Mbps下降到20Mbps左右,ws+tls或者tcp+encrypt都是类似的行为,不过还没有仔细研究。 不过我的环境是两边都是公网的情况下,仅把frp当做隧道使用,测试也是通过这两台机器上用iperf做的。
Author
Owner

@QQ2017 commented on GitHub (Mar 15, 2020):

的确有这种情况发生,我这边也能复现吞吐率从100Mbps下降到20Mbps左右,ws+tls或者tcp+encrypt都是类似的行为,不过还没有仔细研究。
不过我的环境是两边都是公网的情况下,仅把frp当做隧道使用,测试也是通过这两台机器上用iperf做的。

有没有可能流量经过frp转发时,流量被加密,数据特征发生了变化,本地或远程的QOS对其限速?

<!-- gh-comment-id:599156975 --> @QQ2017 commented on GitHub (Mar 15, 2020): > 的确有这种情况发生,我这边也能复现吞吐率从100Mbps下降到20Mbps左右,ws+tls或者tcp+encrypt都是类似的行为,不过还没有仔细研究。 > 不过我的环境是两边都是公网的情况下,仅把frp当做隧道使用,测试也是通过这两台机器上用iperf做的。 有没有可能流量经过frp转发时,流量被加密,数据特征发生了变化,本地或远程的QOS对其限速?
Author
Owner

@HenryChen2022 commented on GitHub (Mar 19, 2020):

国内有公网ip,国外做客户端做端口转发。速度只有4M带宽,

<!-- gh-comment-id:601193413 --> @HenryChen2022 commented on GitHub (Mar 19, 2020): 国内有公网ip,国外做客户端做端口转发。速度只有4M带宽,
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#1333
No description provided.