Fastify did 6K RPS (Request per Second)
Netty did 23K RPS (Request Per Second)
Actix did 53K RPS (Request Per Second)
Actix 1ms latency
Netty 4ms latency
Fastify 14ms latency
npm install -g autocannon
Actix
git clone https://github.com/diegopacheco/rust-playground.git
cd rust-microservice/
cargo build --release
./target/release/news-service
autocannon -c 100 -d 40 -p 10 172.17.0.2:8080/
Netty
docker run diegopacheco/time-microservice
autocannon -c 100 -d 40 -p 10 172.17.0.2:8080/rest/datetime
Fastify
git clone https://github.com/diegopacheco/Diego-Pacheco-Sandbox.git
cd scripts/node.js/fastify-fun2/
npm install
npm start
autocannon -c 100 -d 40 -p 10 localhost:3000
I don't know what you've been testing on your side. On my local machine (Apple M1 Pro) I did the following benchmarks:
Rust webserver (190k RPS):
Running the Rust implementation with
.workers(10)
(same as # of workers in Node) did not improve the RPS.Is there anything else you could do to improve the RPS that I missed?
Single thread Fastify Webserver with Node v16.17 (146k RPS):
Fastify Webserver in Cluster Mode with Node v18.13 (191k RPS):