-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory problem in Socket.IO #181
Comments
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). |
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:
( 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. |
I will definitely try this Cheers |
Oh yeah, small note: I was using the latest version of Socket.IO-node
|
ohh i also am using the Latest version.. How can i use wsbench with SSL??? do you know?? |
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. |
Why is this issue closed??? |
maybe he thought it was the same person. |
This has seems to have fixed the problem!!! |
I'm glad you found the issue. |
Yeah me too :D Which wsbench are you using?? Cheers |
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. |
Can you umm.. perhaps give me an example.. :D |
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...
The text was updated successfully, but these errors were encountered: