An open API service indexing awesome lists of open source software.

https://github.com/vutran1710/benchmarker

Source code for several backend applications subjected for stress-testing
https://github.com/vutran1710/benchmarker

actix benchmarking fastapi python rust stress-testing

Last synced: 15 days ago
JSON representation

Source code for several backend applications subjected for stress-testing

Awesome Lists containing this project

README

          

* Benchmarking several backend applications
- *Why?*
- I'm mainly concerned with what I have in my development toolbelt - that means Python, JS, Clojure & Rust.
- It is widely known that Rust is the most performant language, but still I want to see how fast it is compared
to other frameworks/libraries I've been using daily for enterprise-grade application development.
- Learning fun - Thats why!

** Subjects for testing

- [[https://fastapi.tiangolo.com/][FastAPI (python)]]
- [[https://actix.rs/][Actix-Web (rust)]]
- [[https://github.com/http-kit/http-kit][HTTPKit with Reitis (clojure)]]
- [[https://github.com/networknt/light-4j][Light-4J (java)]]

*NOTE*

- source code for HTTPKit app is [[https://github.com/vutran1710/ClojuricWeb][here]]
- no source code available for Light4j

** Scenario

- Tool: [[https://github.com/codesenberg/bombardier][bombardier]]
- Concurrent connection: 100
- Duration: 30s
- Env: *production* for all test app
- Testing on a simple API that return sum of 2 numbers, in the following format

*GET* ~//plus?x=1&y=3~
#+begin_src shell
# response
{
"total": 4
}
#+end_src

** Results

- HTTPKit
#+begin_src code
$ bombardier -c 100 -d 30s "http://localhost:8080/clojure/plus?x=1&y=3"
Bombarding http://localhost:8080/clojure/plus?x=1&y=3 for 30s using 100 connection(s)
[====================================================================================] 30s
Statistics Avg Stdev Max
Reqs/sec 30265.79 11146.13 48148.98
Latency 3.32ms 3.46ms 319.56ms
Throughput: 6.72MB/s
#+end_src

- FastAPI
#+begin_src code
$ bombardier -c 100 -d 30s "http://localhost:5000/python/plus?x=3&y=1"
Bombarding http://localhost:5000/python/plus?x=3&y=1 for 30s using 100 connection(s)
[===================================================================================] 30s
Statistics Avg Stdev Max
Reqs/sec 10740.29 1730.15 13932.79
Latency 9.32ms 8.50ms 379.46ms
Throughput: 2.22MB/s
#+end_src
/NOTE: to be frank, I expected more from FastAPI/ :(

- Actix-Web
#+begin_src code
$ bombardier -c 100 -d 30s "http://localhost:8080/rust/plus?x=1&y=3"
Bombarding http://localhost:8080/rust/plus?x=1&y=3 for 30s using 100 connection(s)
[===================================================================================] 30s
Statistics Avg Stdev Max
Reqs/sec 81700.23 13506.45 93240.30
Latency 1.22ms 3.18ms 293.96ms
Throughput: 15.40MB/s
#+end_src

- *Light-4J*
#+begin_src code
$ bombardier -c 100 -d 30s "http://localhost:8080/light4j/plus?x=3&y=2"
Bombarding http://localhost:8080/light4j/plus?x=3&y=2 for 30s using 100 connection(s)
[===================================================================================] 30s
Statistics Avg Stdev Max
Reqs/sec 83641.34 11065.35 101699.66
Latency 1.21ms 5.73ms 308.53ms
Throughput: 16.11MB/s
#+end_src

** Summary

- *ActixWeb* ~ *Light-4J*
- *ActixWeb* ~ 2.5x faster than *HTTPKit*
- *HTTPKit* ~ 3x faster than *FastAPI*

May add some more server-app later...