gpt4 book ai didi

php - 为什么websocket可以关闭连接?

转载 作者:行者123 更新时间:2023-12-04 16:14:26 27 4
gpt4 key购买 nike

使用 Ratchet/ react 。

如果我的连接数少于 1000,它运行良好,但是当连接数增加时 - websockets 连接后自动关闭。

是什么原因?

cat /proc/sys/fs/file-nr
5696 0 815941

open files (-n) 16384

cat /proc/sys/fs/file-max
815941

最佳答案

On socketo.me this is adressed in the Deployment tab.

A Unix philosophy is "everything is a file". This means each user connecting to your WebSocket application is represented as a file somewhere. A security feature of every Unix based OS is to limit the number of file descriptors one running application may have open at a time. On many systems this default is 1024. This would mean if you had 1024 users currently connected to your WebSocket server anyone else attempting to connect would fail to do so.



他们还建议更改次要配置以允许更多连接。如果问题没有解决,您可以尝试使用 libevent 或禁用 XDebug,尽管这可能不是必需的。

关于php - 为什么websocket可以关闭连接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34851057/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com