Skip to content

fix: 文件描述符软上限提到 65536,匿名推送限 1000 条同时在线 - #109

Merged
stqfdyr merged 2 commits into
mainfrom
fix/open-files-limit
Oct 10, 2026
Merged

stqfdyr merged 2 commits into
mainfrom
fix/open-files-limit

Conversation

@stqfdyr

@stqfdyr stqfdyr commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator
  • 启动时把软上限 RLIMIT_NOFILE 提到 65536(不超过硬上限)。systemd 与 Docker 的默认软上限都是 1024,约一千条连接时 accept 报 EMFILE 被静默重试,hub 停止响应且日志里没有任何记录。上限提不上去时启动日志里有一条警告。
  • 匿名 /api/ws 推送同时最多 1000 条,超出回 503,页面退回轮询 /api/nodes;登录会话的推送不计入。
  • 推送的单次发送加 10 秒超时:对端不发 FIN 就消失时,不再占着名额等 TCP 放弃(约 15 分钟)。
  • 实测(debug 构建,prlimit --nofile=1024:524288):改前软上限 64 时 50 条匿名连接即让 /api/me 5 秒无响应;改后软上限启动即为 65536,1500 条匿名连接 1000 条建立、500 条被拒,/api/me 与 /api/nodes 30 毫秒内响应。
  • 软上限的提升放在 --help 与 --reset-password 返回之后,两者的输出不带日志行。
  • 顺带订正 outbound_ip 与分片上传两处注释里过时的说法。

@stqfdyr
stqfdyr merged commit 23a81ad into main Oct 10, 2026
1 check passed
@stqfdyr
stqfdyr deleted the fix/open-files-limit branch October 10, 2026 12:12
stqfdyr added a commit to monitor-probe/monitor-document that referenced this pull request Oct 10, 2026
- 开发者文档「推送压缩」之后新增「同时在线的上限」:匿名 `/api/ws` 同时最多 1000 条,超出的握手回 503,登录会话不计入;主题应退回轮询 `/api/nodes` 并隔一段时间再试。
- 对应 hub 的 monitor-probe/monitor#109,随该 PR 发布的 hub 版本生效。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant