[GH-ISSUE #369] 写了个脚本让frpc定时重连,但重连的时候报already in use #272

Closed
opened 2026-05-05 12:04:40 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @laoyur on GitHub (Jun 17, 2017).
Original GitHub issue: https://github.com/fatedier/frp/issues/369

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

What operating system and processor architecture are you using (go env)?
frps: ubuntu 14.04 x64
frpc: windows 7 x86

Steps to reproduce the issue:

  1. frpc.ini固定
  2. 使用脚本让frpc定时重连,方式是强杀,再启动

Describe the results you received:
大部分时间工作正常,有时候重连的时候就报错,端口already in use

Additional information you deem important (e.g. issue happens only occasionally):
frps admin里面,显示该proxy一直online,即便我已经把frpc停了。
然后frps所在server,发现大量的CLOSE_WAIT:

root@server:~# netstat -anp | grep 51000
tcp6       0      0 :::51000                :::*                    LISTEN      12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4787    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.245:47156   CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:8965    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4673    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.245:51684   CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:1393    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx92:56687     CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4671    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4769    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:10218   CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4688    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.245:51135   CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:1071    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4795    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.245:41474   CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4724    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:8528    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4733    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:1672    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4523    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:7695    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4777    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx92:56626     CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4758    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4650    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx92:56586     CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:8442    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx92:56591     CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx92:56583     CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.245:50878   CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4603    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4717    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:8991    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.245:34351   CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4817    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:7141    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:7994    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4582    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4706    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:1228    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4699    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4838    CLOSE_WAIT  12419/frps      
tcp6       1      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4785    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:7305    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:10602   CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx92:56662     CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx92:56714     CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.245:51227   CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4970    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4825    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4672    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4713    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4585    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.245:51492   CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:1157    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4736    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4768    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:9337    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:9306    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4821    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.245:39993   CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4750    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4751    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:1552    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4703    CLOSE_WAIT  12419/frps      
tcp6     596      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:3249    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx92:56656     CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx92:56599     CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:6484    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4737    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4837    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4913    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4770    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4740    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:7684    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4743    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:6346    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx92:56660     CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:8538    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.245:51409   CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx92:56639     CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4746    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:8138    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4794    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4643    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4725    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx92:56657     CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4716    CLOSE_WAIT  12419/frps      
tcp6     596      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:3820    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4782    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4813    CLOSE_WAIT  12419/frps      
tcp6     596      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4306    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.245:51577   CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:7592    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:6815    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4675    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.245:52990   CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4818    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx92:56655     CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx92:56570     CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4773    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:8415    CLOSE_WAIT  12419/frps      
tcp6     596      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:2709    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4629    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4791    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:7277    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4548    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4741    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4728    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4734    CLOSE_WAIT  12419/frps      
tcp6     596      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:1835    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4802    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4739    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4753    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4606    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:9437    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4747    CLOSE_WAIT  12419/frps      
tcp6     596      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:3588    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4674    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4679    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx92:56585     CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx92:56654     CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4873    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4815    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4709    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:7176    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:10663   CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:6751    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4780    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4700    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx92:56658     CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4799    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4921    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.245:51311   CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:9848    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:8020    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:8114    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx92:56706     CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:6834    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4704    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4676    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:1121    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4628    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4788    CLOSE_WAIT  12419/frps      
tcp6       1      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4904    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:10084   CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4786    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.245:55233   CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.245:39390   CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4563    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4763    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:1286    CLOSE_WAIT  12419/frps      
tcp6       1      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4240    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4767    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4729    CLOSE_WAIT  12419/frps      
tcp6     596      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4684    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4812    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4803    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.245:51079   CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4752    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4806    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4720    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4722    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx92:56588     CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:9832    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:5059    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:9771    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:8897    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4994    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:9747    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4781    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.245:47664   CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.245:46377   CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx92:56647     CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:7619    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4772    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:10119   CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:10247   CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4801    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.245:40895   CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:8857    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4557    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:9409    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:5005    CLOSE_WAIT  12419/frps      
tcp6     292      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4705    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.188:4784    CLOSE_WAIT  12419/frps      
tcp6     277      0 xxx.xxx.xxx.xxx:51000    xxx.xxx.xxx.232:6725    CLOSE_WAIT  12419/frps

疑问1:我该如何安全地实现『不修改frpc.ini(即需要固定使用同一个端口)的情况下,定时让frpc稳定地重连』?目前我采用的是强杀frpc,但上面的效果显示这种方案显然有问题

疑问2:一旦出现上述情况:frps admin显示frpc一直在线、大量连接CLOSE_WAIT、frpc其实早就已经不在运行、新frpc进程连过来又报already in use,除了关闭frps外,有没有其他解决方案?

Originally created by @laoyur on GitHub (Jun 17, 2017). Original GitHub issue: https://github.com/fatedier/frp/issues/369 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)?** 0.11.0 **What operating system and processor architecture are you using (`go env`)?** frps: ubuntu 14.04 x64 frpc: windows 7 x86 **Steps to reproduce the issue:** 1. frpc.ini固定 2. 使用脚本让frpc定时重连,方式是强杀,再启动 **Describe the results you received:** 大部分时间工作正常,有时候重连的时候就报错,端口already in use **Additional information you deem important (e.g. issue happens only occasionally):** frps admin里面,显示该proxy一直online,即便我已经把frpc停了。 然后frps所在server,发现大量的CLOSE_WAIT: ``` root@server:~# netstat -anp | grep 51000 tcp6 0 0 :::51000 :::* LISTEN 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4787 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.245:47156 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:8965 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4673 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.245:51684 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:1393 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx92:56687 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4671 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4769 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:10218 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4688 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.245:51135 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:1071 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4795 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.245:41474 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4724 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:8528 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4733 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:1672 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4523 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:7695 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4777 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx92:56626 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4758 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4650 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx92:56586 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:8442 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx92:56591 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx92:56583 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.245:50878 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4603 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4717 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:8991 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.245:34351 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4817 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:7141 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:7994 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4582 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4706 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:1228 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4699 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4838 CLOSE_WAIT 12419/frps tcp6 1 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4785 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:7305 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:10602 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx92:56662 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx92:56714 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.245:51227 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4970 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4825 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4672 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4713 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4585 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.245:51492 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:1157 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4736 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4768 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:9337 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:9306 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4821 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.245:39993 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4750 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4751 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:1552 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4703 CLOSE_WAIT 12419/frps tcp6 596 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:3249 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx92:56656 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx92:56599 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:6484 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4737 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4837 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4913 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4770 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4740 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:7684 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4743 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:6346 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx92:56660 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:8538 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.245:51409 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx92:56639 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4746 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:8138 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4794 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4643 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4725 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx92:56657 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4716 CLOSE_WAIT 12419/frps tcp6 596 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:3820 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4782 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4813 CLOSE_WAIT 12419/frps tcp6 596 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4306 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.245:51577 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:7592 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:6815 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4675 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.245:52990 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4818 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx92:56655 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx92:56570 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4773 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:8415 CLOSE_WAIT 12419/frps tcp6 596 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:2709 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4629 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4791 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:7277 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4548 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4741 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4728 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4734 CLOSE_WAIT 12419/frps tcp6 596 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:1835 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4802 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4739 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4753 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4606 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:9437 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4747 CLOSE_WAIT 12419/frps tcp6 596 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:3588 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4674 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4679 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx92:56585 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx92:56654 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4873 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4815 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4709 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:7176 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:10663 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:6751 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4780 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4700 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx92:56658 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4799 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4921 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.245:51311 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:9848 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:8020 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:8114 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx92:56706 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:6834 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4704 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4676 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:1121 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4628 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4788 CLOSE_WAIT 12419/frps tcp6 1 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4904 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:10084 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4786 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.245:55233 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.245:39390 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4563 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4763 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:1286 CLOSE_WAIT 12419/frps tcp6 1 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4240 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4767 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4729 CLOSE_WAIT 12419/frps tcp6 596 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4684 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4812 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4803 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.245:51079 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4752 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4806 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4720 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4722 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx92:56588 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:9832 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:5059 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:9771 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:8897 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4994 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:9747 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4781 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.245:47664 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.245:46377 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx92:56647 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:7619 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4772 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:10119 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:10247 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4801 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.245:40895 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:8857 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4557 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:9409 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:5005 CLOSE_WAIT 12419/frps tcp6 292 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4705 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.188:4784 CLOSE_WAIT 12419/frps tcp6 277 0 xxx.xxx.xxx.xxx:51000 xxx.xxx.xxx.232:6725 CLOSE_WAIT 12419/frps ``` **疑问1**:我该如何安全地实现『不修改frpc.ini(即需要固定使用同一个端口)的情况下,定时让frpc稳定地重连』?目前我采用的是强杀frpc,但上面的效果显示这种方案显然有问题 **疑问2**:一旦出现上述情况:frps admin显示frpc一直在线、大量连接CLOSE_WAIT、frpc其实早就已经不在运行、新frpc进程连过来又报already in use,除了关闭frps外,有没有其他解决方案?
gitea-mirror 2026-05-05 12:04:40 -06:00
Author
Owner

@fatedier commented on GitHub (Jun 17, 2017):

根据你的重现步骤,无法复现问题。

dashboard 需要刷新,客户端是否下线通过日志最容易看。

不明白重新启动 frpc 的意义是什么。

<!-- gh-comment-id:309212426 --> @fatedier commented on GitHub (Jun 17, 2017): 根据你的重现步骤,无法复现问题。 dashboard 需要刷新,客户端是否下线通过日志最容易看。 不明白重新启动 frpc 的意义是什么。
Author
Owner

@laoyur commented on GitHub (Jun 17, 2017):

frps日志没开……
但是dashboard确实是在frpc杀掉后,刷新过,重复好几遍,也等了好久,依然显示frpc在线,这点我不会乱说
看现象还是挺明了的:大量连接CLOSE_WAIT,然后frps错误地认为frpc还在线,新的frpc实例连过来,但一直被拒绝,因为该端口already in use。其实这种情况下,frps还是可以鉴别出来,之前那个frpc已经事实上掉线了,至少心跳肯定已经没有了,不知道这里我有没有理解错。
当然我重新启动frpc的做法是不太妥当,我本来以为强杀后重连,是不是比frpc自己掉线重连机制能更快恢复通讯

<!-- gh-comment-id:309216583 --> @laoyur commented on GitHub (Jun 17, 2017): frps日志没开…… 但是dashboard确实是在frpc杀掉后,刷新过,重复好几遍,也等了好久,依然显示frpc在线,这点我不会乱说 看现象还是挺明了的:大量连接CLOSE_WAIT,然后frps错误地认为frpc还在线,新的frpc实例连过来,但一直被拒绝,因为该端口already in use。其实这种情况下,frps还是可以鉴别出来,之前那个frpc已经事实上掉线了,至少心跳肯定已经没有了,不知道这里我有没有理解错。 当然我重新启动frpc的做法是不太妥当,我本来以为强杀后重连,是不是比frpc自己掉线重连机制能更快恢复通讯
Author
Owner

@fatedier commented on GitHub (Jun 17, 2017):

看超时,默认 90s,但你提供的信息不足,也没法复现排查这个问题。

有一个新的客户端连接过来,是否立即释放上一个客户端的资源是需要慎重考虑的。目前是保守的方式,只有上一个客户端退出后,才允许同名的连接。

有一种例外,每一次客户端连接服务端后会获取到一个 RunId,从客户端连接到退出是不会改变的。如果断网,重连时,会附带上这个 RunId,服务端如果检测到相同,会知道是同一个客户端,就会立即释放之前占用的资源,完成重连。当你手动停止进程,重启后,会拿到一个新的 RunId,所以被认为是另一个客户端。

<!-- gh-comment-id:309227616 --> @fatedier commented on GitHub (Jun 17, 2017): 看超时,默认 90s,但你提供的信息不足,也没法复现排查这个问题。 有一个新的客户端连接过来,是否立即释放上一个客户端的资源是需要慎重考虑的。目前是保守的方式,只有上一个客户端退出后,才允许同名的连接。 有一种例外,每一次客户端连接服务端后会获取到一个 RunId,从客户端连接到退出是不会改变的。如果断网,重连时,会附带上这个 RunId,服务端如果检测到相同,会知道是同一个客户端,就会立即释放之前占用的资源,完成重连。当你手动停止进程,重启后,会拿到一个新的 RunId,所以被认为是另一个客户端。
Author
Owner

@laoyur commented on GitHub (Jun 18, 2017):

感谢解答!

关于超时,我用的是默认配置。

上述情况确实不是必现,以上重启frpc的方案我稳定跑了好多天后,昨天才遇到 :(

说起为何要重启frpc,原因1是之前发过的一个问题,加密和压缩,当时只说frps占用内存异常,其实frpc也占内存较大的,3分钟即能跑到一二百兆,我frpc是给用户终端提供的代理服务,每5分钟换一次ip,所以我索性在换ip后就杀掉frpc并重连了(我现在关闭加密和压缩了,frpc的内存占用已经没那么大,但定期重启frpc还是对内存占用方面,应该还是有些微帮助的吧);原因2是单方面地期望于杀掉重连能更快速地恢复跟frps的重连。

有一个新的客户端连接过来,是否立即释放上一个客户端的资源是需要慎重考虑的。目前是保守的方式,只有上一个客户端退出后,才允许同名的连接。

这段我同意,不过『上一个客户端退出』这点是如何鉴定的呢,超时应该也算作其一吧?是不是说我遇到的问题,是某种情况下导致超时机制检测失败了,这才是问题的根源?我可以确认的是,等我发现这个问题时,距离出事情的那个frpc客户端掉线(实际上是所在vps换IP后被我强杀),已经过去了几十分钟甚至更长时间,在这段时间内不停地(每5分钟)有新的同名frpc实例连到frps上,但都因为上述策略而被拒。

所以,有没有可能增加一种配置策略,可以达到『有一个新的客户端连接过来,可以立即释放上一个客户端(RunId)的资源』这种目的。

如果觉得这种需求毕竟小众,不会被采纳的话,暂时我只能更改我的策略,取消重启frpc这种方案

<!-- gh-comment-id:309248629 --> @laoyur commented on GitHub (Jun 18, 2017): 感谢解答! 关于超时,我用的是默认配置。 上述情况确实不是必现,以上重启frpc的方案我稳定跑了好多天后,昨天才遇到 :( 说起为何要重启frpc,**原因1**是之前发过的一个问题,加密和压缩,当时只说frps占用内存异常,其实frpc也占内存较大的,3分钟即能跑到一二百兆,我frpc是给用户终端提供的代理服务,每5分钟换一次ip,所以我索性在换ip后就杀掉frpc并重连了(我现在关闭加密和压缩了,frpc的内存占用已经没那么大,但定期重启frpc还是对内存占用方面,应该还是有些微帮助的吧);**原因2**是单方面地期望于杀掉重连能更快速地恢复跟frps的重连。 > 有一个新的客户端连接过来,是否立即释放上一个客户端的资源是需要慎重考虑的。目前是保守的方式,只有上一个客户端退出后,才允许同名的连接。 这段我同意,不过『上一个客户端退出』这点是如何鉴定的呢,超时应该也算作其一吧?是不是说我遇到的问题,是**某种情况下导致超时机制检测失败了**,这才是问题的根源?我可以确认的是,等我发现这个问题时,距离出事情的那个frpc客户端掉线(实际上是所在vps换IP后被我强杀),已经过去了几十分钟甚至更长时间,在这段时间内不停地(每5分钟)有新的同名frpc实例连到frps上,但都因为上述策略而被拒。 所以,有没有可能增加一种配置策略,可以达到『有一个新的客户端连接过来,可以**立即释放**上一个客户端(RunId)的资源』这种目的。 如果觉得这种需求毕竟小众,不会被采纳的话,暂时我只能更改我的策略,取消重启frpc这种方案
Author
Owner

@fatedier commented on GitHub (Jun 18, 2017):

重启对于内存占用没有太大帮助,很快又会恢复到正常占用的数值。

网络情况很复杂,你的问题需要明确的可复现的环境和步骤才能解决。最好是你自己在同样的环境下另外搭建服务端和客户端测试,记录使用的配置,日志,网络环境信息等内容。

<!-- gh-comment-id:309253415 --> @fatedier commented on GitHub (Jun 18, 2017): 重启对于内存占用没有太大帮助,很快又会恢复到正常占用的数值。 网络情况很复杂,你的问题需要明确的可复现的环境和步骤才能解决。最好是你自己在同样的环境下另外搭建服务端和客户端测试,记录使用的配置,日志,网络环境信息等内容。
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#272
No description provided.