Error: not opened
发布于 2 年前 作者 ztiandan 2191 次浏览 来自 问答
Error: not opened
    at WebSocket.send (/var/www/html/site_avalokitesvara/node_modules/ws/lib/WebSocket.js:360:18)
    at Tb.send (/var/www/html/site_avalokitesvara/app/extend/h5service.patch.js:1827:25)
    at Tb.pingAP (/var/www/html/site_avalokitesvara/app/extend/h5service.patch.js:1907:16)
    at Tb.timerCheck (/var/www/html/site_avalokitesvara/app/extend/h5service.patch.js:1900:37)
    at Timeout.<anonymous> (/var/www/html/site_avalokitesvara/app/extend/h5service.patch.js:1928:13)
    at ontimeout (timers.js:475:11)
    at tryOnTimeout (timers.js:310:5)
    at Timer.listOnTimeout (timers.js:270:5) } reason: Error: not opened
    at WebSocket.send (/var/www/html/site_avalokitesvara/node_modules/ws/lib/WebSocket.js:360:18)
    at Tb.send (/var/www/html/site_avalokitesvara/app/extend/h5service.patch.js:1827:25)
    at Tb.pingAP (/var/www/html/site_avalokitesvara/app/extend/h5service.patch.js:1907:16)
    at Tb.timerCheck (/var/www/html/site_avalokitesvara/app/extend/h5service.patch.js:1900:37)
    at Timeout.<anonymous> (/var/www/html/site_avalokitesvara/app/extend/h5service.patch.js:1928:13)
    at ontimeout (timers.js:475:11)
    at tryOnTimeout (timers.js:310:5)
    at Timer.listOnTimeout (timers.js:270:5)

System: Centos 7.4 Language: Nodejs 8.9.4

System configuration [root@web-1 log]# cat /etc/sysctl.conf

fs.file-max = 1000000
vm.overcommit_memory = 1
net.ipv4.ip_local_port_range = 1024 65535
net.ipv4.tcp_fin_timeout = 1
net.ipv4.tcp_keepalive_time = 1200
net.ipv4.tcp_mem = 94500000 915000000 927000000
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_synack_retries = 1
net.ipv4.tcp_syn_retries = 1
net.ipv4.tcp_abort_on_overflow = 0
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.core.netdev_max_backlog = 262144
net.core.somaxconn = 65535
net.ipv4.tcp_max_orphans = 3276800
net.ipv4.tcp_max_syn_backlog = 262144
net.core.wmem_default = 8388608
net.core.rmem_default = 8388608

[root@web-1 log]# cat /etc/security/limits.conf

* hard nofile 1000000
* soft nofile 1000000
root hard nofile 1000000
root soft nofile 1000000

当系统创建的websocket到达1W左右时,系统就不能再创建连接了,我觉得好像是连接数或者文件描述符不够用了,我用curl访问baidu都会超时,上面是我的服务器配置,请问下我应该怎么排查问题?不知道是哪里限制住了,谢谢

[root[@web-1](/user/web-1) log]# lsof -p 1441 | wc
  10524  105213 1255001

[root[@web-1](/user/web-1) log]# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 30724
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1000000
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 30724
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
[root[@web-1](/user/web-1) log]# curl www.baidu.com
1 回复

@ztiandan 楼主找到问题了吗? lsof出来的链接,状态都是正常的ESTABLISHED的吗,有没有大量TIME_WAIT之类不正常的?

回到顶部