sezaru

sezaru

Running multiple nodes in the same machine makes sense?

Hello,

Does it make sense to create a BEAM multi-node architecture if I plan to use it in one machine only?

To elaborate a bit more… In my system a have a complex and big supervisor tree with lots of processes etc. and I need to recreate this entire tree for each external source I support.

This means that if I call my sup tree SupA, and I support sources Source1, Source2 and Source3, I will have to duplicate SupA 3 times, one for each source.

Currently, I already have that implemented, I send the source name when creating the tree so I would get a unique name for each one (and for all processes and supervisors inside SupA too).

So, for example, for Source1, I have SupA.Source1 something like that.

Making all the processes and supervisors have a unique name and keep track of that to call the right one is kind of a pain (I do use Registry in some places to make it a little bit nicer) so I was thinking if I could instead of running everything in a single node, create a node for each one of the sources with its own BEAM.

Does this make sense? What are the pros and cons of such an approach? Is it even a good idea?

If it is, how can I handle the node initialization? Should I just create a script that starts each node for me with the correct parameters or there is something nicer that handles that for me?

Thanks!

Most Liked

keathley

keathley

You certainly can run multiple instances of the BEAM on a single node. But my preference would be to run a single instance and use tools like dynamic supervisor and registry to start the different subtrees as needed. My primary concern with running multiple BEAMS would be performance since you’d be sharing your CPU. I also think that you’d be taking on a fair amount of operational complexity for not a lot of gain. But that might be me projecting since I’m better at managing elixir code and supervisors than I am with ops work.

Where Next?

Popular in Questions Top

openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
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 record...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
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
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
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
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New

Other popular topics Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
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
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New

We're in Beta

About us Mission Statement