socketcluster icon indicating copy to clipboard operation
socketcluster copied to clipboard

stress testing

Open eranegozy opened this issue 7 years ago • 3 comments

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

eranegozy avatar Oct 06 '18 01:10 eranegozy

@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

jondubois avatar Oct 10 '18 18:10 jondubois

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.

eranegozy avatar Oct 11 '18 00:10 eranegozy

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);

Mukund2900 avatar Mar 07 '23 07:03 Mukund2900