-
Notifications
You must be signed in to change notification settings - Fork 88
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
Stress testing send_receive.c fails #40
Comments
Will enable debugging today to see if I can get more information about what's causing the errors |
Got nothing useful out of enabling debug, I still see the output addr being set to null for some reason, I have increased clients to 200000 and also ports, no idea what's going on |
Hi @pthreat, AFAIR, wsServer manages to pass in Autobahn's massconnect mode (for something like 1k clients), so I can't say exactly what's going on. Perhaps the "vusers.failed" occurs due to some kind of timeout, because wsServer takes a while to respond or something like that (since wsServer is very simple in connection management, etc).
200k clients is indeed a massive amount of clients, and I would be very surprised if wsServer could manage this, since wsServer is not async and uses one thread per client. If you need a server for such a large number of clients, maybe wsServer is not the right server for you =/. |
@Theldus Hey man, glad to see you around, I'll paste the test script: Put this in stress.yml
Install artillery (through node's npm)
Then:
|
FWIW I have tried node https://github.com/websockets/ws and tests showed up no problems. |
Hi @pthreat, I ran artillery against Autobahn's Running artillery in debug mode (
I would like to take a closer look at this stacktrace, but my knowledge of Node is pretty minimal. Reading here, it seems to me to be a problem that occurs in the HTTP parsing, probably in the handshake response, since this exact message can occur in other contexts, outside of Artillery. I have the feeling that if I analyze via Wireshark I could find out what the 'bad response' of wsServer is, the problem is locating, as it is quite random and occurs in small quantity. |
@Theldus Sorry, got lost for a few days, would be awesome if a high load would be manageable, I mean if node can manage it so can wsServer ;) . I do know artillery plays dirty doesn't even sends pong or whatever, it plays dirty and that's why I think it's a good stress testing tool. Hope you can crush the issue :) |
@pthreat No worries =),
PING/PONG frames shouldn't exactly be a problem, wsServer works fine without them. What wsServer expects to correctly receive is a valid handshake, as well as valid message frames (TXT, BIN, CONT...). Abnormal closure (no close handshake) also works. What intrigues me the most is that the error is random: sometimes it happens, sometimes it doesn't, which makes debugging very difficult. But I will continue investigating here and I will keep you informed about any progress ;-). |
This commit fixes issue #40 where the Artillery tool was able to force a race condition that occurred on the wsServer (a) and also the premature sending of broadcast messages (b). In detail: a) There was a race condition during the disconnect process, where the 'client_socks' structure was not fully secured with locks, and wsServer tried to send messages to already disconnected clients. b) During the broadcast of messages, the wsServer did not check if the connected clients were already in the 'OPEN' state, that is, if they had already performed the handshake, which made the server send messages prematurely to the clients. Fixed these two issues, now wsServer is able to pass Artillery tests without problems as described in the issue. Signed-off-by: Davidson Francis <[email protected]>
This commit fixes issue #40 where the Artillery tool was able to force a race condition that occurred on the wsServer (a) and also the premature sending of broadcast messages (b). In detail: a) There was a race condition during the disconnect process, where the 'client_socks' structure was not fully secured with locks, and wsServer tried to send messages to already disconnected clients. b) During the broadcast of messages, the wsServer did not check if the connected clients were already in the 'OPEN' state, that is, if they had already performed the handshake, which made the server send messages prematurely to the clients. Fixed these two issues, now wsServer is able to pass Artillery tests without problems as described in the issue. Signed-off-by: Davidson Francis <[email protected]>
Hi @pthreat, There were two things happening: b) During the message broadcast ( Thanks for noticing this, race conditions are generally very difficult to spot and fix, without Artillery this error would remain unnoticed for a long time. Now I get the following output with Artillery:
Please let me know if everything is ok so I can close the issue, and again, thank you very much for spotting this =). |
Hey Theldus sorry I didn't reply earlier. Will check it out when I have sometime trying to stress it! Results look promising. Thanks for fixing this <3 |
I stress tested the send_receive example with artillery.io
I have tried to increase the amount of clients and ports and recompiling the example, however it still fails.
Do I need to augment file descriptors on my system in order to allow many clients sending and receiving at the same time?
PS: I like the interface of this library it's very intuitive, great work!
The text was updated successfully, but these errors were encountered: