You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically, every request that Socket.IO handles increases my Resident Memory by roughly 1Mb..
Memory problem in Socket.IO...
This is not a Node problem, as the same test situation leaves the Resident Memory at the same value..
As far as i can see, using Node-0.4.4 and the latest Socket.IO-node, there is a huge problem with either Websockets or XHR which doesnt clean connections from memory..
I also dont understand why 1 socket.io client connection requires roughly 1Mb... ???
Regardless if i close the connection and reopen it, or keep the connection open and create a new one.. Memory Increases and never ever decreases :(
Can someone please take a look at this.. perhaps im missing something..
I was hoping to use socket.io to maintain 30k + connections on 8gb Ram..
at this rate, ill be lucky to get 8k...
I was experiencing this too since v0.6.16. When I deactivate socket.io in the middle of running my application, the system maintain in 7% of 2gb memory usage and it was about 100+ downloads / second. But, when I activate the socket.io back, It will keep on rising until it reaches 100% and crashes my server. This is a very critical problem and not to mention that my application depends on Socket.IO so much. I hope it can be fixed. (at this time, my application detects there's only 9 connection astablished through socket.io).
( note the -t a custom option that i added, it's the timeout or the amount of time it should stay connected to the server )
What the line above does is create 200 Websockets to the socket.io websocket end point at a rate of 50 connections per second.
During the connection sequence it spiked up to 50mb memory usage, when all handshakes where established the memory level dropped back at 19mb. Disconnecting also spiked the memory 50mb.. and than the memory went back to 13.8~ the same state the server was initially.
Well, maybe It was because I was using www.github.com/substack/dnode for my development. I will try it again later using ordinary socket.io and the latest version.
Under the command I listed "( note the -t a custom option that i added, it's the timeout or the amount of time it should stay connected to the server )"
So I added it manually to test long living connections for Socket.IO. You can basically emulate it your self, by creating a new "session" file for wsbench, add close the websocket connection using a setTimeout.
Activity
pyrostrex commentedon Mar 31, 2011
I was experiencing this too since v0.6.16. When I deactivate socket.io in the middle of running my application, the system maintain in 7% of 2gb memory usage and it was about 100+ downloads / second. But, when I activate the socket.io back, It will keep on rising until it reaches 100% and crashes my server. This is a very critical problem and not to mention that my application depends on Socket.IO so much. I hope it can be fixed. (at this time, my application detects there's only 9 connection astablished through socket.io).
3rd-Eden commentedon Mar 31, 2011
Could you give us some more details? I have been trying to reproduce this issue, but I'm unable to do so.
I'm using wsbench to overload Socket.IO with connections:
node wsbench -c 200 -r 50 -t 20000 ws://127.0.0.1:8080/socket.io/websocket( note the -t a custom option that i added, it's the timeout or the amount of time it should stay connected to the server )
What the line above does is create 200 Websockets to the socket.io websocket end point at a rate of 50 connections per second.
During the connection sequence it spiked up to 50mb memory usage, when all handshakes where established the memory level dropped back at 19mb. Disconnecting also spiked the memory 50mb.. and than the memory went back to 13.8~ the same state the server was initially.
arenstar commentedon Mar 31, 2011
I will definitely try this
using
https://github.com/pgriess/wsbench
and report back
Cheers
3rd-Eden commentedon Mar 31, 2011
Oh yeah, small note: I was using the latest version of Socket.IO-node
On Mar 31, 2011, at 9:05 PM, arenstar wrote:
arenstar commentedon Mar 31, 2011
ohh i also am using the Latest version..
How can i use wsbench with SSL???
do you know??
pyrostrex commentedon Mar 31, 2011
Well, maybe It was because I was using www.github.com/substack/dnode for my development. I will try it again later using ordinary socket.io and the latest version.
arenstar commentedon Mar 31, 2011
Why is this issue closed???
pyrostrex commentedon Apr 1, 2011
maybe he thought it was the same person.
arenstar commentedon Apr 1, 2011
This has seems to have fixed the problem!!!
nodejs/node-v0.x-archive@5c35dff
3rd-Eden commentedon Apr 1, 2011
I'm glad you found the issue.
arenstar commentedon Apr 1, 2011
Yeah me too :D
Which wsbench are you using??
i dont have "time" -t available..
Cheers
3rd-Eden commentedon Apr 1, 2011
Under the command I listed "( note the -t a custom option that i added, it's the timeout or the amount of time it should stay connected to the server )"
So I added it manually to test long living connections for Socket.IO. You can basically emulate it your self, by creating a new "session" file for wsbench, add close the websocket connection using a setTimeout.
arenstar commentedon Apr 1, 2011
Can you umm.. perhaps give me an example.. :D