fatedier / frp

A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet.
Apache License 2.0
85.56k stars 13.26k forks source link

Does frp have some bottleneck at about 100Mbps?(Frp在100Mbps上下存在性能瓶颈?) #1721

Closed jerry-yuan closed 4 years ago

jerry-yuan commented 4 years ago

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)? frp_0.31.1_linux_amd64

What operating system and processor architecture are you using (go env)? OS:Ubuntu Server 18.04.2 LTS (Frp Server) Ubuntu Server 18.04.3 LTS (Frp Client) Architecture: AMD64

Configures you used: Server Side(服务器端):

[common]
bind_port = 7000
# enabled kcp(启用kcp)
kcp_bind_port = 7000

Client Side(客户端):

[common]
server_addr = <frp server ip>
server_port = 7000
protocol = kcp
#...some ports...
# ...

Steps to reproduce the issue: 1.Build up a network with speed more than 100Mbps, like 1Gbps or 10Gbps, with two hosts (建立一个速度超过100Mbps,拥有2台主机的网络,例如1Gbps或者10Gbps) 2.Build up a http server(Nginx,Host A) and test the connection which has been confirmed that the speed between server and client(Host B) is over 10MB/s (建立一个http服务器(位于主机A),例如Nginx,并确定客户端(位于主机B)连接此服务器时的下载速度能够超过10MB/s) 3.Build up the frp server at host A and the frp client at host B (在主机A端建立frp客户端,并在主机B建立frp服务端) 4.Map hostA:80 to hostB:80 (在主机A配置映射nginx至主机B对应端口) 5.Start frpc and frps and make sure that the frp is working well (启动frp并确保它们已经工作正常) 6.Download a file from nginx via host B and measure the download speed (通过主机B访问被转发的http服务器并观测传输速度)

Describe the results you received: I made up this for just making a jump server to protect the real host for convineint. I have known that this probably isn't the right way to build a jump server, but I just want to discuss something unusal state about the performance of frp in some high speed network situation. 我建立这个结构只是为了图方便做一台跳板机来保护实际服务主机,我深知这可能不是一个搭建一台跳板机的正确方式,但是我只是想讨论一些关于Frp在高性能网络中的性能异常状态的事情. I have received a speed around 100Mbps which is much lower than the physical speed 1Gbps. 我发现下载速度只有100Mbps左右,这远远低于机器提供的1Gbps物理带宽. For some performance requirement, I have to replace the frp with iptables. After replace the architectue, I have recieved a more reasonable speed with 1Gbps. 因为一些性能方面的需求,我最后迫不得已使用iptables替换掉了frp.更换掉frp后,我得到了一个更加靠近预期的速度.

Describe the results you expected: I expected anything from the developer. I just want to remind that if there is any performance bottleneck when speed reached around 100Mbps, and discus that if the problem is inside my configuration.Because my cluster only give me a 100Mbps speed with 1Gbps connection. 我不并不期望从开发者那里得到什么回复.我只是想提个醒,在速度达到100Mbps左右的时候是否出现了瓶颈或者讨论一下是不是我的配置在1Gbps链路下导致了瓶颈.因为我的这样配置的一个内网集群在1Gbps链路下只跑出了100Mbps的速度.

Additional information you deem important (e.g. issue happens only occasionally): Thank you for your reply. 感谢您的回复.

Can you point out what caused this issue (optional)

jerry-yuan commented 4 years ago

You can close the issue directly if there is no problem with frp and discus something after the issue closed. 如果您确保frp没有出现问题,您可以直接关闭issue,然后在进行一些讨论.

fatedier commented 4 years ago

Disable kcp first, it's no help in a stable network.

Use tcp without encrytion and compression:

[port]
type = tcp
local_port = 80
remote_port = 80

Retest and observe the CPU consumption of frps and frpc.

jerry-yuan commented 4 years ago

Thank you 谢谢

fatedier commented 4 years ago

@jerry-yuan How about your test result?

jerry-yuan commented 4 years ago

I have disabled the kcp and recieved with a full speed. 我禁用了KCP,然后得到了1Gbps的速度。