-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
连接迟迟不回收导致大量too many open files报错 #1902
Comments
协议是Trojan |
国内网站都不回收,应该跟协议没关系,都没走代理 |
相关配置文件如下 |
根据过往issues,我使用了tun模式后,对m.ithome.com和github.com进行访问,然后立刻断开设备与路由器的WiFi链接,确保不是chrome浏览器在搞什么后台同步长连接啥的问题。换台设备观察连接状态,问题依旧。 |
弱弱的问一句,决定回不回收是受这两个值控制?如果QQ或微信之类的服务器就是能保持空闲连接十多分钟不断开,路由器里运行的内核再每75秒发送一次心跳,那这连接不是永生了? |
哦,心跳包是不是也会同时发给手机,可我手机WiFi都关了,应该通不了,讲道理应该可以回收了 |
vernesong/OpenClash#2614 (comment) 按此解释,结合singbox项目默认值,无效连接最多会在内核中占据内存持续 10min + 75s * 9 = 21.25min,然后被移除,复现步骤修正为: |
遵守此步骤的最新测试结果为: |
My inbound is tproxy, I also encountered memory leak issue. Sing-box service was killed and restarted due to too large memory. Is it a systematic issue? |
我记得我之前用 vless reality (可能)协议遇到过不断开的问题。后来不知道怎么折腾了一番没有遇到过了。 |
我用tproxy会这样(特定的几个网址),换用其他入站了 |
docker版遇到一样的问题,连接一直激活,内存暴涨,然而次数没有流量。 |
有什么解决办法吗 |
我也遇到了,outbound 为 direct 分流局域网的 web 服务,浏览器关闭后,sing-box 继续持有大量局域网的 web 服务连接,久久不释放 |
h2mux就好了 |
可以详细到来吗 |
运行环境:
主要复现过程:
另外,发现如果是国内页面不带 websocket 的,连接基本都可以回收,但是如果页面是 http(s) + websocket 的,则基本无法回收,怀疑大概率是混合代理 websocket 出的问题。 更新测试: |
我这里也是大量的direct没有回收 |
你试试 1.9.4 版本 |
已经是1.9.4了哦,你的正常? |
不正常,但是比 1.10beta5 要好一点点,关掉浏览器就回收了 |
晕,怎么被关闭了,我这个是PT一直挂着的,没法关闭。 |
@tisyang 1.10直接使用1.9.4的配置文件可以吗 |
应该是可以行的。 我的换 1.9.4 后,问题消失,不影响正常应用了。 |
通过修改 sagernet/sing 下的 自行编译需要将 https://github.com/SagerNet/sing-box/blob/dev-next/go.mod#L57 这行注释打开,然后在将 关修改过的 目前测试之前出现问题的网页,开3个标签页,连接数可以稳定在 170+ 左右(页面主要有一堆定时的 fetch 操作会不断创建 http 请求)。 |
操作系统
Linux
系统版本
Linux version 5.4.150 (jenkins@65136d6f01cb) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 unknown)) #0 SMP Mon Jan 30 09:23:25 2023
安装类型
sing-box 原始命令行程序
如果您使用图形客户端程序,请提供该程序版本。
No response
版本
描述
用浏览器访问网站,早就关闭访问了,但十几个小时过去了,连接不回收,导致资源不够,无法访问新的网站
重现方式
路由器上使用 https://github.com/juewuy/ShellCrash ,用singbox内核,选tproxy模式进行透明代理
日志
No response
支持我们
完整性要求
The text was updated successfully, but these errors were encountered: