2016-01-18 09:17
浏览 265


Use Ratchet/React.

If I have less than 1000 connections it works good, but when number of connection is growing up - websockets closing automatically after connection.

What is the reason?

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

open files (-n) 16384

cat /proc/sys/fs/file-max 

图片转代码服务由CSDN问答提供 功能建议


如果我的连接少于1000个 效果很好,但是当连接数量增长时 - websockets在连接后自动关闭。


  cat /  proc / sys / fs / file-nr 
5696 0 815941 
open files(-n)16384 
cat / proc / sys / fs / file-max 
   \  n 
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

  • dongtun3259 2016-03-10 11:58

    On 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.

    They also suggest to change minor configurations to allow more connections. If the problem is not solved you could try to use libevent or disable XDebug although that might not be necessary.

    解决 无用
    打赏 举报

相关推荐 更多相似问题