rm-rf-etc

rm-rf-etc

How many cores is practical for top performance?

I’m not much of a hardware buff, so please excuse my ignorance.

Let’s say I want to build a machine to maximize the performance of some arbitrary elixir service that I’ve built; does it make sense to simply add more cores to scale up the amount of concurrent processes my elixir-based service can parallelize? Does it scale linearly? How should I go about determining the optimum number of cores for my project?

Let’s say, for example, that I have somewhere between 10 and 30 genserver instances subscribed to some external service via websocket (each having its own dedicated websocket), and then I also have some additional processes for my frontend and things like the supervisor. And this is just an arbitrary example for the sake of discussion.

Thanks

Most Liked

dimitarvp

dimitarvp

In a normal high-performance language like Rust I’d say look for some parity between CPU cores and memory channels. F.ex. having 10 CPU cores (20 threads) and a 4-channel memory can make the machine not use its full potential in very memory-intensive apps – of which there aren’t that many, to be fair.

With a language like Elixir though you could easily have a 64-core CPU even with 4-channel memory (like the Threadripper 3990X) because Elixir is not a high-performance language and you’d likely want Elixir for I/O bound workflows because its green-thread preemptive concurrency model will net you insane benefits.

So if you want to focus on Elixir then you can get a lot of cores even if they are a bit slower.

al2o3cr

al2o3cr

The “getting to 1M websockets” stuff is 1000% worth reading / watching, but the big takeaway from that work is pretty simple: the way you figure out these things is to MEASURE.

Exadra37

Exadra37

Maybe reading this article will help:

If you have been paying attention on Twitter recently, you have likely seen some increasing numbers regarding the number of simultaneous connections the Phoenix web framework can handle. This post documents some of the techniques used to perform the benchmarks.

or maybe you prefer to see this conference talk about it:

Both of them will give you more insights into what you are trying to understand, but will not give you a formula :wink:

Where Next?

Popular in Discussions Top

PragTob
Hello everyone, I know we had quite some threads (read through lots of them) about background job processing but it remains a hotly deba...
New
Jayshua
I recently came across the javascript library htmx. It reminded me a lot of liveview so I thought the community here might be interested....
New
fireproofsocks
This is more of a general question, but I’m wondering how other people in the community think about the pattern matching in function sign...
New
lucaong
Hello Elixir and Nerves community, I have been working for a while on an open-source embedded key-value database for Elixir, that I call...
230 13924 124
New
crispinb
On reading dhh’s latest The One Person Framework it strikes me that Phoenix with LiveView is already pretty much this. However, never hav...
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
rms.mrcs
A couple of days ago I was discussing with a friend about different approaches to write microservices. He said that if he was going to w...
New
restack_oslo
Hello, Please pardon me for any faux paux. I am 46 and this is my first time on a forum of any kind. I wanted to to get answers from tho...
New
jesse
Hi everyone, I hesitated to post this here because I don’t want you to think I’m spamming, but I’ve been working on a Platform-as-a-Serv...
New
ben-pr-p
In general I’ve been sticking to this community style guide GitHub - christopheradams/elixir_style_guide: A community driven style guide ...
New

Other popular topics Top

Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
Nvim
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help. Where are they similar? Where do they differ the m...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31142 143
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

We're in Beta

About us Mission Statement