[GH-ISSUE #545] Too many open files in system BUG #424

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

Originally created by @dgben2015 on GitHub (Nov 30, 2017).
Original GitHub issue: https://github.com/fatedier/frp/issues/545

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 将会直接关闭。)

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)?

[root@localhost ~]# frps -v
Frps version 0.13.0

[root@LNMP frp_0.13.0_linux_amd64]# ./frpc -v
0.13.0

What operating system and processor architecture are you using (go env)?

Frps:

[root@localhost ~]# cat /proc/version
Linux version 2.6.32-696.13.2.el6.x86_64 (mockbuild@c1bl.rdu2.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC) ) #1 SMP Thu Oct 5 21:22:16 UTC 2017

frpc:

[root@LNMP frp_0.13.0_linux_amd64]# cat /proc/version
Linux version 2.6.32-642.el6.x86_64 (mockbuild@worker1.bsys.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC) ) #1 SMP Tue May 10 17:27:01 UTC 2016

Configures you used:
FRPS:

[common]
bind_addr = 0.0.0.0
bind_port = 61122
dashboard_port = 61188

dashboard_user = admin
dashboard_pwd = xxx

vhost_http_port = 61180
vhost_https_port = 61443

log_file = /dev/null

log_level = info
log_max_days = 1

privilege_token = xxx

#privilege_allow_ports = 1-65535

max_pool_count = 2000

tcp_mux = true

FRPC:

[common]
server_addr = xxx
server_port = 61122

log_file = ./frpc.log

log_level = info

log_max_days = 1

privilege_token = xxxxx

admin_addr = 127.0.0.1
admin_port = 7400
admin_user = admin
admin_pwd = admin

pool_count = 500
tcp_mux = true
user = xx
protocol = tcp

[W1]
type = http
local_ip = 127.0.0.1
local_port = 80
use_encryption = true
use_compression = true
custom_domains = xx1.com

[W2]
type = http
local_ip = 127.0.0.1
local_port = 80
use_encryption = true
use_compression = true
custom_domains = xx2.com

Steps to reproduce the issue:

1.业务需求: 转发 内部授权系统(FRPC)到公网(FRPS), 客户端 大约 20 个,每个客户端 五秒请求一次
2.运行半个月后 FRPS服务器上的Tomcat 日志提示 "Too many open files in system" ;
3. 使用 lsof -n|awk '{print $2}'|sort|uniq -c |sort -nr|more 查看 进程文件打开数量,发现frps进程 有 六万多 ,导致同服务器(FRPS) 上其他应用无法创建新的链接,触发系统报警.
4.目前解决办法:定时重启frps 期待修复该问题

Describe the results you expected:

请求次数再多也不影响系统

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

FRPS 服务器 Linux 系统已经 不限制 文件句柄打开数量

[root@localhost ~]# cat /proc/sys/fs/file-max
65535

[root@localhost ~]# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 128269
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 65535
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 65535
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

Can you point out what caused this issue (optional)

Originally created by @dgben2015 on GitHub (Nov 30, 2017). Original GitHub issue: https://github.com/fatedier/frp/issues/545 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 将会直接关闭。) 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)?** [root@localhost ~]# frps -v Frps version 0.13.0 [root@LNMP frp_0.13.0_linux_amd64]# ./frpc -v 0.13.0 **What operating system and processor architecture are you using (`go env`)?** Frps: >[root@localhost ~]# cat /proc/version >Linux version 2.6.32-696.13.2.el6.x86_64 (mockbuild@c1bl.rdu2.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC) ) #1 SMP Thu Oct 5 21:22:16 UTC 2017 frpc: >[root@LNMP frp_0.13.0_linux_amd64]# cat /proc/version >Linux version 2.6.32-642.el6.x86_64 (mockbuild@worker1.bsys.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC) ) #1 SMP Tue May 10 17:27:01 UTC 2016 **Configures you used:** FRPS: > [common] > bind_addr = 0.0.0.0 > bind_port = 61122 > dashboard_port = 61188 > > dashboard_user = admin > dashboard_pwd = xxx > > vhost_http_port = 61180 > vhost_https_port = 61443 > > log_file = /dev/null > > log_level = info > log_max_days = 1 > > privilege_token = xxx > > #privilege_allow_ports = 1-65535 > > max_pool_count = 2000 > > tcp_mux = true FRPC: > > [common] > server_addr = xxx > server_port = 61122 > > log_file = ./frpc.log > > log_level = info > > log_max_days = 1 > > privilege_token = xxxxx > > admin_addr = 127.0.0.1 > admin_port = 7400 > admin_user = admin > admin_pwd = admin > > pool_count = 500 > tcp_mux = true > user = xx > protocol = tcp > > [W1] > type = http > local_ip = 127.0.0.1 > local_port = 80 > use_encryption = true > use_compression = true > custom_domains = xx1.com > > [W2] > type = http > local_ip = 127.0.0.1 > local_port = 80 > use_encryption = true > use_compression = true > custom_domains = xx2.com **Steps to reproduce the issue:** 1.业务需求: 转发 内部授权系统(FRPC)到公网(FRPS), 客户端 大约 20 个,每个客户端 五秒请求一次 2.运行半个月后 FRPS服务器上的Tomcat 日志提示 "Too many open files in system" ; 3. 使用 ` lsof -n|awk '{print $2}'|sort|uniq -c |sort -nr|more` 查看 进程文件打开数量,发现frps进程 有 六万多 ,导致同服务器(FRPS) 上其他应用无法创建新的链接,触发系统报警. 4.目前解决办法:定时重启frps 期待修复该问题 **Describe the results you expected:** 请求次数再多也不影响系统 **Additional information you deem important (e.g. issue happens only occasionally):** FRPS 服务器 Linux 系统已经 不限制 文件句柄打开数量 > [root@localhost ~]# cat /proc/sys/fs/file-max > 65535 > [root@localhost ~]# ulimit -a > core file size (blocks, -c) 0 > data seg size (kbytes, -d) unlimited > scheduling priority (-e) 0 > file size (blocks, -f) unlimited > pending signals (-i) 128269 > max locked memory (kbytes, -l) 64 > max memory size (kbytes, -m) unlimited > open files (-n) 65535 > pipe size (512 bytes, -p) 8 > POSIX message queues (bytes, -q) 819200 > real-time priority (-r) 0 > stack size (kbytes, -s) 10240 > cpu time (seconds, -t) unlimited > max user processes (-u) 65535 > virtual memory (kbytes, -v) unlimited > file locks (-x) unlimited **Can you point out what caused this issue (optional)**
gitea-mirror 2026-05-05 12:14:54 -06:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@dgben2015 commented on GitHub (Dec 3, 2017):

该问题在 FRPC掉线(系统断电) ,但客户端 仍然在请求FRPS 时 ,可以 重现

<!-- gh-comment-id:348771416 --> @dgben2015 commented on GitHub (Dec 3, 2017): 该问题在 FRPC掉线(系统断电) ,但客户端 仍然在请求FRPS 时 ,可以 重现
Author
Owner

@fatedier commented on GitHub (Dec 7, 2017):

贴一下更详细的网络连接信息。

ss, lsof 或者 netstat,处于各种状态的连接分别有多少之类的数据。

<!-- gh-comment-id:349865852 --> @fatedier commented on GitHub (Dec 7, 2017): 贴一下更详细的网络连接信息。 ss, lsof 或者 netstat,处于各种状态的连接分别有多少之类的数据。
Author
Owner

@sunyongke commented on GitHub (Oct 30, 2020):

我也是出现了这个问题。内部假设了一个sharelatex,这个软件好像和服务器之间每个一段时间要通讯一次,目前基本只有我一个人在用。服务器基本没2天就会出现too many open files 提示。

<!-- gh-comment-id:719584929 --> @sunyongke commented on GitHub (Oct 30, 2020): 我也是出现了这个问题。内部假设了一个sharelatex,这个软件好像和服务器之间每个一段时间要通讯一次,目前基本只有我一个人在用。服务器基本没2天就会出现too many open files 提示。
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#424
No description provided.