How to create a concurrency test in a shell script?

I am trying to replicate the concurrency test in a shell script, either using netcat or whichever tool you suggest.

This is the test that I am trying to replicate:

So, the test starts a few Redis clients and uses them in parallel, at the same time. But, they don’t close a connection automatically after sending a command from a client. They manually close the connections (sockets/streams) at the end, but they keep the connection alive for the whole duration of the test. If I use nc it will close the connection after sending a single command, so I can’t use it for a concurrency test, at least not in the default way.

Does somebody have an idea how to make this work?

Hey @ivanbgd, you’re right! Using netcat for concurrency testing can be tricky.

While writing a custom script (for example in Python) is an option, it’s probably much simpler to just use our tester.

1 Like

Hi @andy1li,

Thank you for the reply.

I passed the stage but I am trying to build my own testing environment, if nothing, then for practice, so I’d still appreciate if somebody has an idea of how to do it. As I said, it doesn’t have to necessarily employ netcat. I’d like to try out different solutions and it would be easier to debug locally, with more detailed debug output.

1 Like