[GH-ISSUE #1812] 批量转发端口出现错误: too many open files #1431

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

Originally created by @pluveto on GitHub (May 18, 2020).
Original GitHub issue: https://github.com/fatedier/frp/issues/1812

大约转发 10000 个端口,就不行了。

Redirecting to /bin/systemctl status frps.service
● frps.service - Frp Server Service
   Loaded: loaded (/usr/lib/systemd/system/frps.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2020-05-18 22:46:51 CST; 3min 12s ago
 Main PID: 1659 (frps)
   CGroup: /system.slice/frps.service
           └─1659 /usr/local/bin/frps -c /etc/frp/frps.ini

May 18 22:49:55 VM_0_11_centos frps[1659]: 2020/05/18 22:49:55 http: Accept error: accept tcp [::]:8891: accept4: too many open files; retrying in 1s
May 18 22:49:56 VM_0_11_centos frps[1659]: 2020/05/18 22:49:56 http: Accept error: accept tcp [::]:8891: accept4: too many open files; retrying in 1s
May 18 22:49:57 VM_0_11_centos frps[1659]: 2020/05/18 22:49:57 http: Accept error: accept tcp [::]:8891: accept4: too many open files; retrying in 1s
May 18 22:49:58 VM_0_11_centos frps[1659]: 2020/05/18 22:49:58 http: Accept error: accept tcp [::]:8891: accept4: too many open files; retrying in 1s
May 18 22:49:59 VM_0_11_centos frps[1659]: 2020/05/18 22:49:59 [D] [control.go:434] [344b03a4caa744d3-aa95503746cc08e1] receive heartbeat
May 18 22:49:59 VM_0_11_centos frps[1659]: 2020/05/18 22:49:59 http: Accept error: accept tcp [::]:8891: accept4: too many open files; retrying in 1s
May 18 22:50:00 VM_0_11_centos frps[1659]: 2020/05/18 22:50:00 http: Accept error: accept tcp [::]:8891: accept4: too many open files; retrying in 1s
May 18 22:50:01 VM_0_11_centos frps[1659]: 2020/05/18 22:50:01 http: Accept error: accept tcp [::]:8891: accept4: too many open files; retrying in 1s
May 18 22:50:02 VM_0_11_centos frps[1659]: 2020/05/18 22:50:02 http: Accept error: accept tcp [::]:8891: accept4: too many open files; retrying in 1s
May 18 22:50:03 VM_0_11_centos frps[1659]: 2020/05/18 22:50:03 http: Accept error: accept tcp [::]:8891: accept4: too many open files; retrying in 1s

Originally created by @pluveto on GitHub (May 18, 2020). Original GitHub issue: https://github.com/fatedier/frp/issues/1812 大约转发 10000 个端口,就不行了。 ``` Redirecting to /bin/systemctl status frps.service ● frps.service - Frp Server Service Loaded: loaded (/usr/lib/systemd/system/frps.service; enabled; vendor preset: disabled) Active: active (running) since Mon 2020-05-18 22:46:51 CST; 3min 12s ago Main PID: 1659 (frps) CGroup: /system.slice/frps.service └─1659 /usr/local/bin/frps -c /etc/frp/frps.ini May 18 22:49:55 VM_0_11_centos frps[1659]: 2020/05/18 22:49:55 http: Accept error: accept tcp [::]:8891: accept4: too many open files; retrying in 1s May 18 22:49:56 VM_0_11_centos frps[1659]: 2020/05/18 22:49:56 http: Accept error: accept tcp [::]:8891: accept4: too many open files; retrying in 1s May 18 22:49:57 VM_0_11_centos frps[1659]: 2020/05/18 22:49:57 http: Accept error: accept tcp [::]:8891: accept4: too many open files; retrying in 1s May 18 22:49:58 VM_0_11_centos frps[1659]: 2020/05/18 22:49:58 http: Accept error: accept tcp [::]:8891: accept4: too many open files; retrying in 1s May 18 22:49:59 VM_0_11_centos frps[1659]: 2020/05/18 22:49:59 [D] [control.go:434] [344b03a4caa744d3-aa95503746cc08e1] receive heartbeat May 18 22:49:59 VM_0_11_centos frps[1659]: 2020/05/18 22:49:59 http: Accept error: accept tcp [::]:8891: accept4: too many open files; retrying in 1s May 18 22:50:00 VM_0_11_centos frps[1659]: 2020/05/18 22:50:00 http: Accept error: accept tcp [::]:8891: accept4: too many open files; retrying in 1s May 18 22:50:01 VM_0_11_centos frps[1659]: 2020/05/18 22:50:01 http: Accept error: accept tcp [::]:8891: accept4: too many open files; retrying in 1s May 18 22:50:02 VM_0_11_centos frps[1659]: 2020/05/18 22:50:02 http: Accept error: accept tcp [::]:8891: accept4: too many open files; retrying in 1s May 18 22:50:03 VM_0_11_centos frps[1659]: 2020/05/18 22:50:03 http: Accept error: accept tcp [::]:8891: accept4: too many open files; retrying in 1s ```
Author
Owner

@fatedier commented on GitHub (May 19, 2020):

可以优化系统参数(不推荐这种用法!!!),如果有大量端口转发的需求,建议使用 VPN。

<!-- gh-comment-id:630544772 --> @fatedier commented on GitHub (May 19, 2020): 可以优化系统参数(不推荐这种用法!!!),如果有大量端口转发的需求,建议使用 VPN。
Author
Owner

@pluveto commented on GitHub (May 19, 2020):

可以优化系统参数(不推荐这种用法!!!),如果有大量端口转发的需求,建议使用 VPN。

大佬求详情!请问 VPN 如何实现把内部服务器的端口暴露到公网?

<!-- gh-comment-id:630567803 --> @pluveto commented on GitHub (May 19, 2020): > 可以优化系统参数(不推荐这种用法!!!),如果有大量端口转发的需求,建议使用 VPN。 大佬求详情!请问 VPN 如何实现把内部服务器的端口暴露到公网?
Author
Owner

@jinmiaoluo commented on GitHub (May 19, 2020):

  1. 在内网配置 VPN 服务作为 NAT 网关转发流量
  2. 将 VPN 服务监听的端口通过 FRP 映射到公网服务器并暴露出去
  3. 本地通过 VPN 客户端访问远程服务器的IP和绑定的Port. 连接 VPN 服务端
  4. 成功后即可访问内网设备的局域网IP
    On Mon, May 18, 2020 at 09:14:11PM -0700, pluveto wrote:

可以优化系统参数(不推荐这种用法!!!),如果有大量端口转发的需求,建议使用 VPN。

大佬求详情!请问 VPN 如何实现把内部服务器的端口暴露到公网?

--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/fatedier/frp/issues/1812#issuecomment-630567803

<!-- gh-comment-id:630668714 --> @jinmiaoluo commented on GitHub (May 19, 2020): 1. 在内网配置 VPN 服务作为 NAT 网关转发流量 2. 将 VPN 服务监听的端口通过 FRP 映射到公网服务器并暴露出去 3. 本地通过 VPN 客户端访问远程服务器的IP和绑定的Port. 连接 VPN 服务端 4. 成功后即可访问内网设备的局域网IP On Mon, May 18, 2020 at 09:14:11PM -0700, pluveto wrote: > > 可以优化系统参数(不推荐这种用法!!!),如果有大量端口转发的需求,建议使用 VPN。 > > 大佬求详情!请问 VPN 如何实现把内部服务器的端口暴露到公网? > > -- > You are receiving this because you are subscribed to this thread. > Reply to this email directly or view it on GitHub: > https://github.com/fatedier/frp/issues/1812#issuecomment-630567803
Author
Owner

@blizard863 commented on GitHub (May 19, 2020):

可以优化系统参数(不推荐这种用法!!!),如果有大量端口转发的需求,建议使用 VPN。

大佬求详情!请问 VPN 如何实现把内部服务器的端口暴露到公网?

这个搜下 VPN 的搭建和使用吧。

<!-- gh-comment-id:630713785 --> @blizard863 commented on GitHub (May 19, 2020): > > 可以优化系统参数(不推荐这种用法!!!),如果有大量端口转发的需求,建议使用 VPN。 > > 大佬求详情!请问 VPN 如何实现把内部服务器的端口暴露到公网? 这个搜下 VPN 的搭建和使用吧。
Author
Owner

@pluveto commented on GitHub (May 19, 2020):

  1. 在内网配置 VPN 服务作为 NAT 网关转发流量 2. 将 VPN 服务监听的端口通过 FRP 映射到公网服务器并暴露出去 3. 本地通过 VPN 客户端访问远程服务器的IP和绑定的Port. 连接 VPN 服务端 4. 成功后即可访问内网设备的局域网IP

    On Mon, May 18, 2020 at 09:14:11PM -0700, pluveto wrote: > 可以优化系统参数(不推荐这种用法!!!),如果有大量端口转发的需求,建议使用 VPN。 大佬求详情!请问 VPN 如何实现把内部服务器的端口暴露到公网? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: #1812 (comment)

如果我想把 80 端口暴露给全网,你这样好像不行,你这样要安装客户端。

<!-- gh-comment-id:630756299 --> @pluveto commented on GitHub (May 19, 2020): > 1. 在内网配置 VPN 服务作为 NAT 网关转发流量 2. 将 VPN 服务监听的端口通过 FRP 映射到公网服务器并暴露出去 3. 本地通过 VPN 客户端访问远程服务器的IP和绑定的Port. 连接 VPN 服务端 4. 成功后即可访问内网设备的局域网IP > […](#) > On Mon, May 18, 2020 at 09:14:11PM -0700, pluveto wrote: > 可以优化系统参数(不推荐这种用法!!!),如果有大量端口转发的需求,建议使用 VPN。 大佬求详情!请问 VPN 如何实现把内部服务器的端口暴露到公网? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: [#1812 (comment)](https://github.com/fatedier/frp/issues/1812#issuecomment-630567803) 如果我想把 80 端口暴露给全网,你这样好像不行,你这样要安装客户端。
Author
Owner

@zzjjbb commented on GitHub (May 21, 2020):

  1. 在内网配置 VPN 服务作为 NAT 网关转发流量 2. 将 VPN 服务监听的端口通过 FRP 映射到公网服务器并暴露出去 3. 本地通过 VPN 客户端访问远程服务器的IP和绑定的Port. 连接 VPN 服务端 4. 成功后即可访问内网设备的局域网IP

    On Mon, May 18, 2020 at 09:14:11PM -0700, pluveto wrote: > 可以优化系统参数(不推荐这种用法!!!),如果有大量端口转发的需求,建议使用 VPN。 大佬求详情!请问 VPN 如何实现把内部服务器的端口暴露到公网? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: #1812 (comment)

他想问的应该是如何做出来一个和frp等效的、透明的转发吧,可以让公网服务器自己连接那个转发的内网vpn,然后配置一下路由规则(虽然我不会写

<!-- gh-comment-id:632282919 --> @zzjjbb commented on GitHub (May 21, 2020): > > 1. 在内网配置 VPN 服务作为 NAT 网关转发流量 2. 将 VPN 服务监听的端口通过 FRP 映射到公网服务器并暴露出去 3. 本地通过 VPN 客户端访问远程服务器的IP和绑定的Port. 连接 VPN 服务端 4. 成功后即可访问内网设备的局域网IP > […](#) > On Mon, May 18, 2020 at 09:14:11PM -0700, pluveto wrote: > 可以优化系统参数(不推荐这种用法!!!),如果有大量端口转发的需求,建议使用 VPN。 大佬求详情!请问 VPN 如何实现把内部服务器的端口暴露到公网? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: [#1812 (comment)](https://github.com/fatedier/frp/issues/1812#issuecomment-630567803) 他想问的应该是如何做出来一个和frp等效的、透明的转发吧,可以让公网服务器自己连接那个转发的内网vpn,然后配置一下路由规则(虽然我不会写
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#1431
No description provided.