tsenart / vegeta

HTTP load testing tool and library. It's over 9000!
http://godoc.org/github.com/tsenart/vegeta/lib
MIT License
23.51k stars 1.36k forks source link

Customizable/templatable attack batch requests #334

Closed toh2526 closed 6 years ago

toh2526 commented 6 years ago

Proposal

Customizable/templatable attack batch requests.

Background

Sometimes we have to load test one URL with variety mix of POST body or GET params. Untill all items in the list get consumed. It could help a lot with template requests + CSV/JSON param lists like what's been done in jMeter.

Workarounds

For now? Maybe with parallel command used in here: https://www.simonholywell.com/post/2015/06/parallel-benchmark-many-urls-with-apachebench/

tsenart commented 6 years ago

This is already possible today by writing a small program or script that generates targets on the fly. I had good experiences using ‘jq’ for that purpose.

tsenart commented 6 years ago

You need to use the -lazy flag in vegeta attack together with that script.

majkinetor commented 5 years ago

Does this solution works in cross platform manner ?

tsenart commented 5 years ago

Not sure if Windows has any sort of pipes. But Windows 10 has a Linux sub-system with Bash so you can use that. https://docs.microsoft.com/en-us/windows/wsl/install-win10

majkinetor commented 5 years ago

Yes, windows has pipes. PowerShell pipeline can also 'feed' the app continiously.

Should I really install linux subsystem for load test ? :) No, not at all.

tsenart commented 5 years ago

Great, so feel free to test it!

lhauspie commented 4 years ago

This is already possible today by writing a small program or script that generates targets on the fly. I had good experiences using ‘jq’ for that purpose.

Hi, thanks for this information. But I'm afraid it's not enough for me to begin.

Do you have an example of script to do that ? Very interested by this feature.

Thanks in advance.

tsenart commented 4 years ago

@lhauspie: vegeta attack can consume targets that are generated on the fly by specifying the -lazy flag. Then any program can produce those targets and write them to a file or pipe that vegeta attack takes in.

./your_target_generating_program.sh | vegeta attack -lazy ...

You can produce those targets in the JSON format which is much easier to work with than the HTTP format.