musialny.dev

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

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

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

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

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:

Where Next?

Popular in Questions Top

Kurisu
For example for a current url like http://localhost:4000/cosmetic/products?_utf8=✓&query=perfume&page=2, I would like to get: ...
New
LegitStack
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call t...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New

Other popular topics Top

AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
boundedvariable
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New

We're in Beta

About us Mission Statement