► What should I test next? ► AWS is expensive - Infra Support Fund: buymeacoffee.com/antonputra ► Benchmarks: kzbin.info/aero/PLiMWaCMwGJXmcDLvMQeORJ-j_jayKaLVn&si=p-UOaVM_6_SFx52H
@Z3U5.0g2 ай бұрын
Axum vs Fibre
@razagr2 ай бұрын
web socket connections test in go/rust
@dqueisme20102 ай бұрын
Elixir phoenix vs rust axum
@j-p-d-e-v2 ай бұрын
Laravel (PHP) vs Fiber (Go) vs Axum (Rust) vs Django (Python)
@caiomestresmendes18682 ай бұрын
Id like to see a benchmark with the differences between microservices comunications : grpc, rest and rabbitmq -latency , memory and cpu using any linguage is fine
@SkegAudio2 ай бұрын
its amazing how the differentials are so minute the availability graph scales to show difference, but in great scheme of things they're all still within 99% available: thats crazy rust is so performant 😯
@AntonPutra2 ай бұрын
💯
@olokelo2 ай бұрын
Based on your tests all of these frameworks performed really impressively. Honestly the differences seem to be rather small and I feel like using any of them would give you super high performance web server.
@AntonPutra2 ай бұрын
true
@nsing3232 ай бұрын
I guess victory goes to just which one is easier to work with for quick results
@AntonPutra2 ай бұрын
@@nsing323 true
@j-p-d-e-v2 ай бұрын
Great content, I was actually thinking of whether I use Axum or Actix in my project though my first choice is Actix. Now Im decided to stick with it.
@StingSting8442 ай бұрын
Please understand that raw req/s is not a metric to select a framework. Its a lot of different things. Top priority should be ergonomics and ease of implementation. The moment your app needs to handle 10k/s it's a huge scale already
@AntonPutra2 ай бұрын
well actix has more starts 😊
@hansiboy53482 ай бұрын
You should try Nodejs vs Bun vs Deno
@__nemesis__15712 ай бұрын
Also express fastify Elysia hono
@AntonPutra2 ай бұрын
will do!
@belkocik2 ай бұрын
I would like to see a clustered fastify web server vs go std lib
@theintjengineer2 ай бұрын
Nodejs and Bun+Hono lose against Bun+Elysia. Elysia is really fast.
@pietraderdetective89532 ай бұрын
@@theintjengineer I just did this test yesterday and yes Bun+Elysia is super performant. I did Bun vs Elysia and Bun got 47k rps while Elysia 60k rps in a 1 thread 10 connections setting. Any idea what's the optimization done by Elysia to achieve such performance?
@Carlozei13372 ай бұрын
I see a video from Anton, I click and watch it. It's that easy ;-D
@AntonPutra2 ай бұрын
haha thanks!
@shm2362 ай бұрын
Correct me if im wrong, but actix utilizes a more singular request to thread strategy while axum uses a more work pool threading strategy. Considering they are
@viniciusataidedealbuquerqu28372 ай бұрын
stateless tends to be more asynchronous no?
@shm2362 ай бұрын
@viniciusataidedealbuquerqu2837 stateless requests are more async/thread friendly but then someone needs to handle the state in the interim. I was attempting to reference the nature of how load is assigned to threads. The result is that axum FEELS nicer to build more complex middleware and such, while actix feels much more straightforward. But that's just my personal experience.
@viniciusataidedealbuquerqu28372 ай бұрын
@@shm236 gotcha thank you
@AntonPutra2 ай бұрын
interesting
@yelan50342 ай бұрын
Fantastic! It seem like there is not much performance difference between them. If I ever need to write a web application in Rust, I think I will go with the one that is easier to use and has better community support.
@AntonPutra2 ай бұрын
axum looks cleaner
@adho122 ай бұрын
Do you have an idea what causes the degradation of performance? The usual suspects mem ans cpu seem to be good… Could you maybe have reached the host socket limits?
@AntonPutra2 ай бұрын
i don't think so, but i'll double check next time. It's a eks cluster and usually you don't directly manage nodes. i may try to using serverless eks (fargate) next time
@agustinpizarro2 ай бұрын
~25000 limit is very suspiciously associted to some hardcoded limit
@sqrmap2 ай бұрын
The combo of all services failing at the same time + no service being near their resource limits + no service p99 latency being near what would be required to cause a 408 response would indicate that some other limit had been reached before the services themselves degraded.
@LKamii2 ай бұрын
Was looking for this. This test is testing the aws nodes and not the frameworks. Great test setup otherwise and hope you upload a rerun after figuring out what limit you hit.
@NekoApril2 ай бұрын
This is actually a pretty good point, iirc the default limit in linux is somewhere in the 25k-32k range. And if they're all pushing the limits of the OS, that's insanely impressive for all of them.
@milendenev49352 ай бұрын
Your videos are the best! Keep going, I saw a comment Zig vs Rust, this will be very interesting!
@AntonPutra2 ай бұрын
yes it is coming next
@milendenev49352 ай бұрын
@@AntonPutra Thank you very much!
@ImSplashGG2 ай бұрын
I love your videos, you are the channel I've seen that makes the best benchmarks, putting them to the test as it would be in the real world and with a clear way to see the results, keep it up :) 🎉
@AntonPutra2 ай бұрын
thank you! i'll keep adding more metrics in the future just for the reference
@hoarsebeesАй бұрын
26k seems pretty close to ephemeral port exhaustion. You may want to look into either increasing this limit or allowing the load generator to re-use connections between requests (Connection:keep-alive) or tweaking the load generator to not have more than that many connections open at a time.
@AntonPutraАй бұрын
thank you! i've improved those benchmarks in the latest videos
@thinhbui48352 ай бұрын
I use axum for api gateway, hope it perform well when deploy on a vps
@AntonPutra2 ай бұрын
it's very close to actix..
@RustIsWinning2 ай бұрын
Damn that's a lot of crabs 🦀🦀🦀
@AntonPutra2 ай бұрын
🤣
@specy_2 ай бұрын
Here you are again
@badscrew40232 ай бұрын
The fact the three start failing at the same moment, tells there is something common between the frameworks that doesn't tolerate the load, or perhaps the problem is outside.
@AntonPutra2 ай бұрын
yes, it's infra issue, more precisely the issue with a go client :)
@mike-barber2 ай бұрын
This _potentially_ looks like it might be hitting a different bottleneck. Maybe like the ingress controller or load balancer or something. I know from load testing my own Rust web application on K8s, the thing we max out first is the load balancers (haproxy in my case) rather than the app itself. Anyway, it looks very similar to what we're observing here - the app never gets close to 100%, but the load balancer pods are maxed out. A good way to rule this out is to run the app directly on an EC2 machine and hit it with wrk, or something equivalent that can generate enough load without hitting limits itself. Then we'll know how fast it actually is before plugging it into K8s. You might have checked this already, of course - but would be interesting to know :)
@AntonPutra2 ай бұрын
Thanks! I don't use a load balancer or ingress controllers in this video, only native Kubernetes networking (Service of type ClusterIP). yaml - github.com/antonputra/tutorials/tree/main/lessons/206/deploy/actix-app
@CalifornianViking2 ай бұрын
I had exactly the same reaction. All three frameworks are failing at about the same time while all the other metrics seem fine. Why would it stop serving if the latency is way below 1 mSec and the CPU (40% ish) and memory loads (1.5% ish) are fine? What else could be causing the failure
@AntonPutra2 ай бұрын
@@CalifornianViking it could be dns, cause i was using service name
@CalifornianViking2 ай бұрын
@AntonPutra I don't think it would resolve the domain name that often Did you check other constraints such as networking or container limitations? Could you run the test on bare metal or in a VM?
@hoarsebeesАй бұрын
I agree with this. TechEmpower’s Actix gets over 1M RPS, so failing at 26k is a red flag.
@BosonCollider2 ай бұрын
A failure mode where latency goes up to 2 ms and "only" 99.8% availability is fun
@AntonPutra2 ай бұрын
well it was done on the same vm without any external dependencies so i think it is reasonable
@codispatch68692 ай бұрын
Great video thanks for sharing. Can you please compare Rust Actix and Go Fiber ? If already done - can you please share the link? Thank you so much 🙏
@AntonPutra2 ай бұрын
i have one 2 videos ago, but i didn't push it to the end.. i'll update soon
@codispatch68692 ай бұрын
@@AntonPutra Awesome 😎 Thanks allot 👍
@Quozul2 ай бұрын
Awesome video, thanks! It'd be interesting to include salvo too, since it claims to be the fastest Rust web framework!
@AntonPutra2 ай бұрын
interesting, ok!
@dminik91962 ай бұрын
One thing that might be interesting would be to flip this around. Pick one of the implementations and try to compare similarly sized/priced options between aws, gcp and azure.
@AntonPutra2 ай бұрын
thanks, i was thinking about it. will do in near future
@ahmadumar93872 ай бұрын
boah many many thanks this was the most helpful benchmark for me :)
@AntonPutra2 ай бұрын
my pleasure :)
@s1v7Ай бұрын
It would be nice to compare the performance of Hyper with the simplest implementation based solely on Tokio.
@AntonPutraАй бұрын
noted!
@Mr.BinarySniper2 ай бұрын
Please make a video on "Deno" vs "Bun" vs "Node 22"
@AntonPutra2 ай бұрын
ok, noted!
@amarquaye2 ай бұрын
Please try Fastapi vs Robyn vs Flask next time.
@AntonPutra2 ай бұрын
ok noted!
@shneor.e2 ай бұрын
All equally slow lol
@pietraderdetective89532 ай бұрын
For the slower (Python) frameworks, there are methods to make them more performant rather easily. 1. Use FastWSGI for Flask or other sync based frameworks. 2. Use Granian for Quart/FastAPI or other async based frameworks. Yeah they are slow, but to make them moderately fast is easy. Note they're never gonna reach the same levels as Go/Rust/Zig.
@MrHirenP2 ай бұрын
Very interesting charts. But what’s the takeaway? All three seem to perform similarly. Is it fair to say that the choice depends on developer experience? Or is there something else to consider at runtime?
@AntonPutra2 ай бұрын
So far, yes, it's about developer experience. I'll keep adding more metrics and graphs, and over time, I may discover additional behavioral differences.
@DavidAlsh2 ай бұрын
I couldn't find the source for "aputra/utils-tester-amd64" but if you exceed 128 concurrent connections the Rust servers will stop processing new connections by default. I'm not sure why the Rust stdlib has such a low default for max concurrent connections - but that might be why all of the servers all tanked at around the same req/s despite having plenty of CPU and RAM to work with. I raised a PR for your previous test increasing the max connection count
@AntonPutra2 ай бұрын
thanks! merged i'll try in new video
@nehjain2 ай бұрын
Can you do rust(actix) vs nodejs(express) so I can convince my team and manager to use rust over nodejs 😅
@AntonPutra2 ай бұрын
haha, yes soon
@ernestdesbordes2 ай бұрын
Same here.
@ProGamerru2 ай бұрын
Wow! Thank you! Axum forever :)
@RustIsWinning2 ай бұрын
Actix forever :)
@AntonPutra2 ай бұрын
fiber beats all of them 😂
@mikemoore6672 ай бұрын
Hello, a real question. If there's CPU resource (max 40%) and RAM available, why does the application start failing responses? Where's the bottleneck, what's missing? Disk? Connections?
@AntonPutra2 ай бұрын
possible socket count but i haven't tested this yet, take a look at this PR - github.com/antonputra/tutorials/pull/264
@complexity5545Ай бұрын
What benchmark graphing tool is he using? Never mind -- grafana and prometheus . I had to watch the video again. I missed it the first time around.
@brianteague80312 ай бұрын
Can we also include Node just to see the difference between Rust and JS performance?
@AntonPutra2 ай бұрын
yes, soon
@zacksalah58792 ай бұрын
Great video! Just FYI the LTO optimization gets disabled when you set codegen to 1.
@AntonPutra2 ай бұрын
interesting, is it in the docs or i just missed it?
@zacksalah58792 ай бұрын
@@AntonPutra Actually, my bad. If you set LTO to false and set codegen to 1, it won't perform any LTO optimization. I must have read it wrong.
@AntonPutra2 ай бұрын
@@zacksalah5879 no worries
@lintaoamons57122 ай бұрын
Hi Anton, love your content! I’m recently learning Prometheus and want to know your promql for generating those benchmarks diagrams! Can you share those with me? Thanks!
Why does rust start falling over even thou it does not max out CPU or ram? Is this more the networking interface falling over?
@AntonPutraАй бұрын
that was an infra issue, i've made some improvements after that
@shadowangel-ou6bg2 ай бұрын
Did you test different async runtimes? For latency maybe a thread per core framework will work better like bytedances Monoio or a non-async frame work.
@AntonPutra2 ай бұрын
i may test it in the future, but in container it is tricky
@crasite2 ай бұрын
I like the developer experience with Axum. It's good to know that it's not that bad compared to Actix.
@AntonPutra2 ай бұрын
it is very close
@romainjouhameau27642 ай бұрын
It would be interesting to see examples using python (fastapi or django) or js
@AntonPutra2 ай бұрын
ok, noted!
@OttoAkama22 күн бұрын
What version of Axum? 0.6 or 0.7?
@AntonPutra22 күн бұрын
0.7, i provide a link to the source code under each of my videos - github.com/antonputra/tutorials/blob/main/lessons/206/axum-app/Cargo.toml#L7C9-L7C12
@dmitrii_cl2 ай бұрын
Maybe go vs php? Because a lot of companoes rewrite their php projects on go. So, go is a php replacer for them.
@AntonPutra2 ай бұрын
sure i was thinking about php for some time
@elalemanpaisa2 ай бұрын
I hope your EC2 instances had dedicated CPU cores so there was no problem with shared resources
@AntonPutra2 ай бұрын
I usually run these tests at least three times before recording, so the results are always consistent, and I use new EC2 instances each time.
@renbangbprd72362 ай бұрын
Please do Java Spring Boot (Native) vs Spring Boot (JDK) VS Quarkus (Native) vs Quarkus (JDK)
@AntonPutra2 ай бұрын
thanks will do
@cyncred2 ай бұрын
would appreciate something like bun vs actix
@AntonPutra2 ай бұрын
thanks! noted!
@pietraderdetective89532 ай бұрын
Rocket vs Jetzig should be interesting. Both in Release mode please 😅
@AntonPutra2 ай бұрын
ok noted :)
@DmitryIlyashevich2 ай бұрын
Which framework did you like to write code the most?
@AntonPutra2 ай бұрын
not rocket :)
@EduardKaresli2 ай бұрын
I'm new to the Rust ecosystem. Shouldn't Leptos be also included in this test? I thought Leptos is the most popular web framework for Rust... 🤔
@galower4052 ай бұрын
Even tho I believe Leptos has SSR capabilities, Leptos is more focused on the client than the server. It is a frontend framework that works with web assembly to run on the browser.
@EduardKaresli2 ай бұрын
@@galower405 Oh, I see, thanks for the explanation.
@AntonPutra2 ай бұрын
webassembly is coming soon
@SidharthKaushik2 ай бұрын
How many concurrent users did you tested and is it feasible to test 1000 users as ab -n 2000 -c 1000 -k localhost/test
@AntonPutra2 ай бұрын
20 pods starting with 1 cient ~> 160 so max was 20*160 = 3200
@adeveloper6653Ай бұрын
Why does axum have a better score on techempower benchmarks?
@AntonPutraАй бұрын
I’m not sure, but I’ll do some more testing soon, covering the top Rust frameworks
@adriandrozman34042 ай бұрын
how about node vs bun vs deno?
@AntonPutra2 ай бұрын
yes coming soon
@AntonioSchiavon2 ай бұрын
pls compare actix against web servers made for non-usual async runtimes like hyper using smol runtime and submillisecond (lunatic runtime)
@AntonPutra2 ай бұрын
ok noted
@arimill10452 ай бұрын
I'd like to see using Rust w/ lambda w/o a web framework vs using the framework at all.
@AntonPutra2 ай бұрын
i have older video comparing lambdas but i'll definitely make a new one
@arimill10452 ай бұрын
@@AntonPutra the big question for me is the inflection point where value switches from scaling lambdas to servers running fargate ECS and ec2 reserved instances. The numbers are of course heavily determined on what you want them to do, but it'd be nice to see rules of thumb, eg: 15kreq/sec for random crud updates is when ECS is more cost effective than lambda, so if you're under that stay serverless
@AntonPutra2 ай бұрын
@@arimill1045 ok got it
@TheNoirKamui2 ай бұрын
I though Rocket would be even worse. And I though Axum would be better. I am still a big fan of axum, but there seams to be less development on it recently. I really thought axum would clearly win the rust web war over time, but I am less certain now.
@AntonPutra2 ай бұрын
the difference is very small between axum and actix
@AlwaysStaringSkyward2 ай бұрын
26K req/s is plenty enough for me :)
@legends_assemble49382 ай бұрын
For almost all the normal cases, it is overkill.
@AlwaysStaringSkyward2 ай бұрын
For sure. I personally enjoy Rust because of the type safety and the language features. I like Axum because it seems well designed. The performance is a pleasant side effect and also makes it cheap to host the stuff I create.
@AntonPutra2 ай бұрын
💯
@tetuaoro2 ай бұрын
ty for this video
@AntonPutra2 ай бұрын
🫡
@biswajitthakur82702 ай бұрын
Nodejs vs Rust please
@AntonPutra2 ай бұрын
ok noted!
@SidharthKaushik2 ай бұрын
+1 please mate
@user-de8d2 ай бұрын
Next C++ vs Rust vs Zig based web frameworks please....
@AntonPutra2 ай бұрын
zap (zig) is comming next
@kamurashev2 ай бұрын
Nice stuff
@AntonPutra2 ай бұрын
thank you!
@baegopado2 ай бұрын
🔥
@AntonPutra2 ай бұрын
❤️
@yapet2 ай бұрын
Wow, that seems like a lot of unnecessary over engineering, to setup a multi-node k8s cluster on a greatly-multi-core nodes, and to limit rusts notoriously multithreaded async runtimes to two cores. I get that it is more closely emulating a production-like environment, but I dunno. Seems like this additional complexity doesn’t buy you much.
@AntonPutra2 ай бұрын
Well, that's a typical deployment. I may go over each optimization technique I've got so far in the future.
@minciNashu2 ай бұрын
Looks like you're using the multithreaded flavor runtime for Tokio, but for containers I would choose the single thread flavor, since you don't have CPU cores, and the workstealing overhead is quite substantial.
@AntonPutra2 ай бұрын
thanks for the tip
@justinjustin46052 ай бұрын
Is it possible to get something 100k rps with 100ms latency?
@AntonPutra2 ай бұрын
yes i got 150k rps with 2 cpu, in a new video
@SidharthKaushik2 ай бұрын
@@AntonPutrawhen are you posting mate and also with how many concurrent users did
@iRoNYwho2 ай бұрын
do haskell vs rust
@AntonPutra2 ай бұрын
noted
@Andrew-zv1vw2 ай бұрын
Go vs Elixir please
@AntonPutra2 ай бұрын
ok noted!
@svetlinzarev34532 ай бұрын
Rust is the best!
@AntonPutra2 ай бұрын
one of the best for sure
@VanAntony-l3k2 ай бұрын
Garcia Shirley Hernandez Edward Wilson Jason
@AntonPutra2 ай бұрын
?
@severgun2 ай бұрын
Some love to python
@AntonPutra2 ай бұрын
soon
@thunyasitthАй бұрын
It's all not different.....0.5 or 1 percent is not significant in real environment.
@thisistotest2 ай бұрын
Sir, C++ vs Rust.
@AntonPutra2 ай бұрын
thanks, noted!
@VanAntony-l3k2 ай бұрын
Moore Kenneth Lopez Shirley Williams Angela
@AntonPutra2 ай бұрын
?
@abdellahcodes2 ай бұрын
laughs in Javascript 💀
@AntonPutra2 ай бұрын
😊
@_tsu_2 ай бұрын
Just goes to show how overkill rust is for server apps
@ryanseipp69442 ай бұрын
I'd argue it isn't overkill if it means you can reduce your hosting costs by a large margin. To get close to this in ruby/python you'd need many more instances running, load balancers, k8s (maybe). Where here you can run one instance and not need to bother with any of that complexity
@AntonPutra2 ай бұрын
i'm curious how well rust can replace data pipelines that so many companies have, for example storm topos, spark/flink and just in general kafka consumers and producers...
@ryanseipp69442 ай бұрын
@@AntonPutra feels like a good use case for processing/streaming large amounts of data. Calculate more with the same infrastructure and get better insights? I'd guess the largest blocker for most companies is just the ecosystem vs doing something custom