jaybe78

jaybe78

Hello,

I would like to know up to how many nodes max we can run a distributed app with a simple libray like libcluster ?

I read somewhere that after 40/50 nodes, you can start having issues like loss of messages and it generally does not scale well above that number.

For the context:

I’m currently building an app with an expectation of 2/3 millions concurrent users.
Those users would spread around 300 000 + channels.
So each channel would contain something like 100 users or less joining and they would mostly exchange chat messages.

Phoenix Presence is set up on those channels so an user can be aware at anytime of whose connected.

I heard about an Erlang library called Partisan that is used for very large cluster, but I guess for my use cases lib cluster should be enough ?

If anyone has been working in a distributed app it would be nice to share your feedback here.

Cheers.

Showing Posts 1 to 10

Hermanverschooten

Hermanverschooten

There is maybe something for you here.

And I just wanted to mention that libcluster despite it’s name does not cluster.
It’s all Erlang that does the clustering, libcluster just helps you with finding the nodes to connect through the strategies it offers.

jaybe78

jaybe78 OP

Yes seen this one. Thanks.

Your’re right, libcluster only helps you to find the nodes.

Though I still wanted some feedback from people who have used “default” Erlang without any library to manage their cluster, just to see if it makes sense for me at this point to look into a library that can handle much more complex and large cluster.

Also, I guess I’m a bit “intimidated” by Partisan, from what I seen in the docs, there’s no clear documentation about how to set up Partisan locally in an elixir app…

I can see that you can join nodes manually

Though I was looking for a solution where Partisan discover nodes automatically.

In my case I would also have to make it work in an AWS ECS service, and I’m not sure whether it would work seamlessly or it does require some extra configuration !?

The only thing I had to do so far to set up an erlang cluster was to use aws service discovery to resolve DNS names so that was quite easy…

pleb

pleb

Consider first if your use case actually requires clustering the entire thing, instead of partitioning it into groups of three or five with a stateful load balancer to guide people to the right group.

Check if a consistent hashing scheme like GitHub - lambdaclass/elixir_riak_core: Wrapper to Riak Core for Elixir · GitHub wouldn’t function better for your use case.

jaybe78

jaybe78 OP

If I understand correctly riak creates virtual nodes within one physical node to spread the load rather than creating new physical nodes ?

pleb

pleb

Virtual nodes are spread across physical nodes, and the dynamic partitioning scheme allows physical nodes to be added and removed while virtual nodes always find the closest physical server in the event that a node is removed to recover, or spread out when a new node is added.

Although this scheme might not work too well, if the number of participants is not uniform, and one partition is overwhelmed, as was the case with How Discord Scaled Elixir to 5,000,000 Concurrent Users implementing a similar scheme

jaybe78

jaybe78 OP

Ok thanks.

Riak seems overly complexed (at least for me), I had a look at riak-core-lite but no activity there since 2021…

mpope

mpope

I saw this talk at code beam, truly the rocket science of BEAM with 40k nodes!

jaybe78

jaybe78 OP

lol really interesting but I guess at the moment I’m far from being able to do that kind of work on my own :smiley:

mpope

mpope

Fair enough, thought for food.

For automated discovery specifically take a look at GitHub - nerves-networking/mdns_lite: A simple, no frills mDNS implementation in Elixir · GitHub

jaybe78

jaybe78 OP

yes thanks definitely interesting :slight_smile:

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews