Performance testing and benchmarking tools
In this post I want to show you 3 different load testing solutions for your performance benchmarks/tests. From simple to advanced.
1. Wrk
Simple “point and shoot” solution. My go-to solution for quick load test of GET requests to single URL. For multiple URLs one can use Lua scripts. Results are helpful, although sometimes you want more details.
Example of wrk benchmark:
wrk -d 10 -c 200 --latency --timeout 5s "http://localhost:8081/hello?name=world"
In results, you can see requests/sec, latency distribution etc.
2. Vegeta
Written in go, so you can just download the binary from GitHub. More capable than wrk, need some time to dive in. Following the UNIX spirit, vegeta consists of several commands with you can combine to get different results.
You can generate “targets” from any source - file, curl or script output. Reporting capabilities are also broader, from simple text results
print "GET http://localhost:8081/hello?name=world" | vegeta attack -duration=10s -rate=5000/1s | tee results.bin | vegeta report
to hdr plots
print "GET http://localhost:8081/hello?name=world" | vegeta attack -duration=10s -rate=5000/1s | tee results.bin | vegeta plot > plot.5000qps.html
Vegeta supports different types of requests, as well as http2 protocol. Also, you can use Vegeta programmatically with Go API.
3. Gatling
Its a tool which you can use in self-hosted or cloud environment. It has Java/Scala/Kotlin API to write advanced scenarios using DSL. You can re-use parts of your benchmarks as code. You can map this scenario to this benchmark as code snippet
Results output are beautiful yet informative html charts that you can browse and share. The learning curve is higher, but this instrument gives you more capabilities.
For different cases you might need different tools. Which one suits your use cases? Let’s discuss on twitter.
3 Different load testing solutions for your performance benchmarks/tests. From simple to advanced: 🧵#scala #java #kotlin #go #benchmarking #performance-testing
— Dmytro Kovalenko (@dkovalenko_fun) February 16, 2022