socket.io:高流量时的错误请求错误

时间:2015-07-20 21:30:24

标签: node.js sockets socket.io

当我以高负载(+500连接)运行socket.io聊天应用程序时,我收到该错误

webSocket connection to 'ws://myIp:1400/socket.io/?EIO=3&transport=websocket&sid=GLQPwRHTgJCN9lFhAAoO' failed: 
Connection closed before receiving a handshake response
socket.io.js:95 GET http://myIp:1400/socket.io/?EIO=3&transport=polling&t=1437426459994-177&sid=GLQPwRHTgJCN9lFhAAoO
 400 (Bad Request)17.Request.create @ socket.io.js:95Request @ socket.io.js:9017.XHR.request @ socket.io.js:9017.XHR.doPoll @ socket.io.js:9018.Polling.poll @ socket.io.js:10718.Polling.onData @ socket.io.js:109(anonymous function) @ socket.io.js:909.Emitter.emit @ socket.io.js:3517.Request.onData @ socket.io.js:9617.Request.onLoad @ socket.io.js:10217.Request.create.xhr.onreadystatechange @ socket.io.js:94
chat.js.php:204 Error: xhr poll error
    at XHR.14.Transport.onError socket.io.js:9017.XHR.request @ socket.io.js:9017.XHR.doWrite @ socket.io.js:90(anonymous function) @ socket.io.js:110(anonymous function) @ socket.io.js:183proxy @ socket.io.js:218(anonymous function) @ socket.io.js:183(anonymous function) @ socket.io.js:18225.exports.encodePacket @  

我尝试使用 pm2模块,但没有帮助。

关于如何解决这个问题的想法?

1 个答案:

答案 0 :(得分:0)

群集模块无法与Socket.io 1.x

配合使用

https://github.com/Unitech/PM2/issues/637