musialny.dev
How good is Elixir throughput?
Is really elixir (especially with phoenix) has good throughput? I’m recently seeing a lot of benchmark and “real use cases” benchmarks where elixir is loosing with asp .net, jvm etc.
Marked As Solved
dimitarvp
Are you projecting more than 50K requests per second?
If no, Elixir is going to be quite enough and always will be.
Below added for context:
Also Liked
carterbryden
I’ve never trusted any of these benchmarks because I regularly have elixir outpace the other things I’m integrating it with. To the point where it crashes/locks up the other software with too much throughput, because it’s incredibly easy to parallelize just about anything I want to do and processes are tiny and cheap.
I also run https://approximated.app, which at this point manages clusters for almost 200k domains/subdomains. And while it’s not elixir running on each cluster (though I wish it was), it is a single elixir phoenix instance handling the millions of API reqs. And much more intensively, performing the constant monitoring of each of those domains. Monitoring means a DNS check, SSL check, and hitting the actual url of the domain to check status, response headers, etc.
As of this writing, that instance runs on 8gb of ram and 4vcpu (about $40/month). 99% of the time it uses about a quarter of it, but it gives me a lot of room if something really extraordinary happens. It’s never crashed, and only ever become slightly slower a couple of times.
One was due to not having rate limits on the api, and a user mistakenly automated deleting and then recreating their domains in approximated every time a request for that domain hit their app. Including requests for assets that happen in the background. The other was a poorly thought out recursive loop I manually ran from iex, and then went for lunch. Both times it maxed out the cpus for the duration but nothing failed or crashed. Just took longer to complete.
Anyways, hopefully that real world example gives you a better sense of elixir performance and throughput.
sergio
I led the engineering org at Papa, a YC unicorn worth north of 1.5B by the time I left.
The amazing team did a great job with Elixir.
Want to know what was the bottleneck for our performance 99.99% of the time? It wasn’t Elixir. It was almost always Postgres query tuning that saved the day.
I think this may be the case for the vast majority of apps. Stop sorting large arrays in app code, let the database to the work. Elixir will get you very very far performance wise.
derpycoder
I made the mistake of going by the benchmarks and making the most optimal choices possible before I discovered Elixir.
I saw the Tech “empower” benchmark and since I hated C++, Java, & Golang, I decided to go with Rust.
I lost 3 months trying to make a production worthy app.
Actix Web is fast, no doubt, but I’m the one who was slowing it down with my inexperience.
I was merging a templating engine, with asynchronous approach and was using RwLock to read the templates and eventually ran across thread poisoning issue.
I was unable to see what was happening in the runtime, a problem I was sick and tired of after making a large project in Nodejs.
Monitoring and error logging was lacking, I had to figure out conventions.
I’m sure my app was the most secure of them all, not because of Rust, but because it’s never going to see the light of day.
Perhaps I should have gone with Rocket, but if you see Techempower benchmark, it’s way down even though it’s written in Rust.
So it seems; doing the right things, properly and secure and being able to run indefinitely takes much more than a barebones Actix app.
Jose Valim has a great article on this topic:
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex









