[GH-ISSUE #2226] 首次连接需要等待时间超过5s #1768

Closed
opened 2026-05-05 13:08:28 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @zsinba on GitHub (Jan 30, 2021).
Original GitHub issue: https://github.com/fatedier/frp/issues/2226

[REQUIRED] hat version of frp are you using

Version: 0.35.1

[REQUIRED] What operating system and processor architecture are you using
OS: Debian
CPU architecture: AMD64

[REQUIRED] description of errors

confile

log file

Steps to reproduce the issue

  1. 我有使用FRPS服务端安装在对外的服务器上面,然后内部机器安装 FRPC.
  2. 内部机器 通过FRPC把10110端口映射出到外网,外网也是使用10110
  3. 使用CDN网络把10110这个地址映射出来了,用户访问我的Web应用时, 通过域名www.abc.com,就可以访问到我的x.x.x.x:10110的服务器.
    4.问题出现在: 每次首首访问www.abc.com的时候,都要等5s左右.后面就正常了. 怀疑是FRPS和FRPC建立连接的原因. 我有尝试过在FRPC使用connection pool参数,设置最小值 是5,在服务器(FRPS)上面设置的最大值是50. 但是,用完连接后怀疑他还是做了释放,所以造成每次首次连接的时候,都要等待差不多5s.

请问有无办法,让这个首次连接的时间降低. "首次连接"这个也是我猜测的,因为我在打开web的时候,仅首次慢,后面不会慢的.所以是这样怀疑.
我也怀疑过是CDN连接到我的服务器的原因, 但是尝试过不经过FRP转发,直接暴漏10110端口,通过路由器端口转发,是没有这个问题的,所以应该不是CDN的原因.

顺便提一下,我是使用了CDN资源 ,服务器放在自己机房,这样即可以使用云资源提供网络,又可以不把服务器放在云上. 而CDN的价格是很低的, 这样就可以在高性价比的情况下使用云资源 .

Supplementary information

Can you guess what caused this issue

Checklist:

  • [] I included all information required in the sections above
  • [] I made sure there are no duplicates of this report (Use Search)
Originally created by @zsinba on GitHub (Jan 30, 2021). Original GitHub issue: https://github.com/fatedier/frp/issues/2226 <!-- From Chinese to English by machine translation, welcome to revise and polish. --> <!-- ⚠️⚠️ Incomplete reports will be marked as invalid, and closed, with few exceptions ⚠️⚠️ --> <!-- in addition, please use search well so that the same solution can be found in the feedback, we will close it directly --> <!-- for convenience of differentiation, use FRPS or FRPC to refer to the FRP server or client --> **[REQUIRED] hat version of frp are you using** <!-- Use ./frpc -v or ./frps -v --> Version: 0.35.1 **[REQUIRED] What operating system and processor architecture are you using** OS: Debian CPU architecture: AMD64 **[REQUIRED] description of errors** **confile** <!-- Please pay attention to hiding the token, server_addr and other privacy information --> **log file** <!-- If the file is too large, use Pastebin, for example https://pastebin.ubuntu.com/ --> **Steps to reproduce the issue** 1. 我有使用FRPS服务端安装在对外的服务器上面,然后内部机器安装 FRPC. 2. 内部机器 通过FRPC把10110端口映射出到外网,外网也是使用10110 3. 使用CDN网络把10110这个地址映射出来了,用户访问我的Web应用时, 通过域名www.abc.com,就可以访问到我的x.x.x.x:10110的服务器. 4.问题出现在: 每次首首访问www.abc.com的时候,都要等5s左右.后面就正常了. 怀疑是FRPS和FRPC建立连接的原因. 我有尝试过在FRPC使用connection pool参数,设置最小值 是5,在服务器(FRPS)上面设置的最大值是50. 但是,用完连接后怀疑他还是做了释放,所以造成每次首次连接的时候,都要等待差不多5s. 请问有无办法,让这个首次连接的时间降低. "首次连接"这个也是我猜测的,因为我在打开web的时候,仅首次慢,后面不会慢的.所以是这样怀疑. 我也怀疑过是CDN连接到我的服务器的原因, 但是尝试过不经过FRP转发,直接暴漏10110端口,通过路由器端口转发,是没有这个问题的,所以应该不是CDN的原因. 顺便提一下,我是使用了CDN资源 ,服务器放在自己机房,这样即可以使用云资源提供网络,又可以不把服务器放在云上. 而CDN的价格是很低的, 这样就可以在高性价比的情况下使用云资源 . **Supplementary information** **Can you guess what caused this issue** **Checklist**: <!--- Make sure you've completed the following steps (put an "X" between of brackets): --> - [] I included all information required in the sections above - [] I made sure there are no duplicates of this report [(Use Search)](https://github.com/fatedier/frp/issues?q=is%3Aissue)
gitea-mirror 2026-05-05 13:08:28 -06:00
Author
Owner

@fatedier commented on GitHub (Feb 5, 2021):

建议打开服务端和客户端的日志 debug 日志,发送一个请求后,把这个请求相关的日志和时间都贴一下,这样比较方便排查问题。

<!-- gh-comment-id:773819430 --> @fatedier commented on GitHub (Feb 5, 2021): 建议打开服务端和客户端的日志 debug 日志,发送一个请求后,把这个请求相关的日志和时间都贴一下,这样比较方便排查问题。
Author
Owner

@github-actions[bot] commented on GitHub (Mar 23, 2021):

Issues go stale after 45d of inactivity. Stale issues rot after an additional 10d of inactivity and eventually close.

<!-- gh-comment-id:804512772 --> @github-actions[bot] commented on GitHub (Mar 23, 2021): Issues go stale after 45d of inactivity. Stale issues rot after an additional 10d of inactivity and eventually close.
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#1768
No description provided.