alexfernandez / loadtest

Runs a load test on the selected URL. Fast and easy to use. Can be integrated in your own workflow using the API.
MIT License
2.58k stars 210 forks source link

Readme is incorrect in terms of --cores #237

Open fetis opened 6 months ago

fetis commented 6 months ago

Default: half the available CPUs on the machine.

My command

npx loadtest -H ... -t 5 -c 20 http://localhost:8080/xxx

My output

Max time (s):        5
Concurrent clients:  120
Running on cores:    6
Agent:               none

Completed requests:  162
Total errors:        0
Total time:          6.364 s
Mean latency:        2112.9 ms
Effective rps:       25

I see that it utilizes all available (6) cores, instead of 3.

Also, for me, it looks like concurrency is taken per core, not per process. So total clients will be CORES*CONCURENCY

Loadtest v8

@alexfernandez If it's correct, I can update the doc

alexfernandez commented 6 months ago

@fetis Make sure that you don't have 6 cores with hyper-threading, which shows as 12 to the operating system and to os.cpus() which is what loadtest uses.