SocketCluster / socketcluster

Highly scalable realtime pub/sub and RPC framework
https://socketcluster.io
MIT License
6.15k stars 314 forks source link

stress testing #447

Open eranegozy opened 6 years ago

eranegozy commented 6 years ago

Hello, I'd like to write (or find) some stress-testing or load-testing app where I can simulate many clients connecting to my socketcluster server.

I saw this: https://github.com/SocketCluster/sc-stress-tests, but there is no useful README so I am not sure if this is what I am looking for or how to run it.

Any advice? Thanks, Eran

jondubois commented 6 years ago

@eranegozy this repo needs to be cleaned up a bit. Also it needs more tests; now there is only a single one called many-subscribers; it tests a very specific scenario which checks how many clients can subscribe to the same channel (if the channel gets a new message every second).

Feel free to clean up that logic and add more test scenarios.

Iddeally you need to run node server/server.js on one machine and then you run node client/client.js on a different machine. You can pass the target hostname, port and number of clients using command line arguments. See https://github.com/SocketCluster/sc-stress-tests/blob/master/client/client.js#L8-L10

eranegozy commented 6 years ago

gotcha. Thanks. I did manage to write my own customized stress test using this example. A bit busy right now, but yeah, I'll take a look and maybe try to clean up this repo sometime in the near future.

Mukund2900 commented 1 year ago

The stress test works fine with 1000 clients but breaks when i increase it to 30k subscribers. Why is this happening ? @jondubois

all i get is Client connection establishment timed out , works fine with 10000 clients as well.

let numClients = Number(argv.clients || 10000);