giltene / wrk2

A constant throughput, correct latency recording variant of wrk
Apache License 2.0
4.23k stars 381 forks source link

How to choose appropriate thread, connection and rate ? #94

Open baiwfg2 opened 4 years ago

baiwfg2 commented 4 years ago

These three factors are tightly related. It's very easy for users to give a wrong rate which doesn't match with the given threads or connections. How should we avoid this ?

Furthermore I don't understand why rate parameter is required. What if I just want to stress the server with unlimited rate ?

baiwfg2 commented 4 years ago

Check the following two images. Why does the latency go up heavily when I increase rate ?

image

image

baiwfg2 commented 4 years ago

When I want rate to be fixed, but I don't know the lower bound numbers of connections can reach that fixed rate. After all I'd rather choose that number, because when num of connections go up, the latency go up too.

jsrz commented 4 years ago

Just some thoughts, this doesn't answer your question.

I think you bring up a great question. Some general guidance on how to set these parameters would be great. That said, I think the answer to your question of "what if I want an unlimited rate" is to simply set rate some ungodly large number like 10 billion requests per second. Of course, what this means is that whatever latency is reported is not useful.

As for connection count. I think the appropriate value here might be more related to the server you are stress/load testing. It's likely dependent on how many connections the server you are trying to test can handle. Also, don't set it so large that you see any sort of connection/socket errors.

As for threads, I always just match it up with the number of threads/cores on the machine running wrk2.

yangxuhui commented 3 years ago

Greate qustion.

Check the following two images. The result is very confusing!

image

image