nodejs socket.io什么都不做,只是连接100%cpu

我是新的nodeJs和socket.io,当我运行它达到CPU 100%(CPU跳跃14-103%..)时,我有大约800个用户在该网站。 起初,我看到的问题是,每隔几分钟,所有的用户断开连接,并在几秒钟后重新连接,所以我注意到所有的代码结束了连接和断开…仍然5分钟后CPU达到跳跃CPU 14- 100%..我不知道要检查什么,因为横向上只是最基本的东西..节点版本 – 0.10.25 socket.io版本 – 1.0代码片段 –

var redis = require('redis').createClient(), server = require('http').createServer(), request = require('request'), io = require('socket.io').listen(server), sockets = {}; // , memcache = require('memcache') // , cookie = require('cookie') // run HTTP server on this port server.listen(3000); console.log('started node sockets.'); // only allow authenticated connections - TODO: check if its doing anything.. :x io.set('authorization', function(handshake, callback) { return callback(null, true); }); io.sockets.on('connection', function(socket) { var id = getUserId(socket); if( id === false) return; // store user's socket sockets[id] = socket; console.log('User ' + id + ' connected'); request({url:"http://www.-----.co/nodeConnect", qs:{id: id}},function(){}) socket.on('disconnect', function() { id = getUserId(socket); if( id === false ) return; // store user's socket delete sockets[id]; console.log('User ' + id + ' disconnect'); request({url:"http://www.----.co/nodeDisconnect", qs:{id: id}},function(){}); }); function getUserId(socket) { if( typeof socket.handshake.headers.cookie == 'undefined' ) return false; // HOTFIX - check it var cookie = socket.handshake.headers.cookie; var startAt = cookie.indexOf('; uid=') + 6; var tempUid = cookie.substr(startAt); return tempUid.substr(0, tempUid.indexOf(';') ); // return id. } 

该服务器是一个非常强大的服务器32cpu,120GB RAM。 运行nginx,php,nodejs,大约1000 ppl ..我应该检查得到这个运行没有吃我所有的CPU? 顺便说一下,这个节点应用程序实际上应该使用多lessCPU?

问题是连接和断开的请求,它们很慢,而且由于大量的stream量,CPU也被占用了。