I'm using node v4.2.1 with socket.io (I have tested even with websocket/ws getting "better" result, but still not enough). At the moment there are few opened connections (hundreads) and the usage percentage of memory is 38% (I'm running on a AWS t2.small Ubuntu 14.04.2 LTS (GNU/Linux 3.13.0-48-generic x86_64)).
The server code is embarrising simple (just for test):
... declaration ...
io.on('connection', function(socket){
socket.send("hi");
});
As far as the client code is concerned, I'm using the corresponding socket.io version. How is it possible that sockets occupy all that space in memory?
Moreover, I'm following this post:
http://www.jayway.com/2015/04/13/600k-concurrent-websocket-connections-on-aws-using-node-js/
and I run the server with --expose-gc flag but seems doesn't working (Every 30 seconds I force the garbage collector global.gc), any guess?