Erynn

Erynn

Using :rpc.call or :rpc.multicall - which is better for performance and speed?

suppose i have 1000 nodes connected in a ring, connect_all set false and manually connected in a ring. each node have 1 genserver means 1000 genserver. if one genserver fail and registered with new pid.

now tell me which approch is better for performance and speed.
1 after registering new pid it send new pid to all 999 nodes by using :rpc.multicall.

2 or remaining 999 nodes use rpc.call to get new pid (suppose i have a library which inform all remote node about pid failure).

Most Liked

al2o3cr

al2o3cr

Registered with what process? On which node?

When you’re running in a network where nodes aren’t connected to every other node, “where does this happen” becomes a really important question.

A process running on one of the nodes in the ring is only going to be able to communicate with its neighbors, so is there a centralized “directory” node here? That’s where a 999-node :rpc.multicall would need to be sent from…

An approach that avoids a centralized server would be for the GenServer on node #X to reach out to node #X-1 and node #X+1 when it boots up to “announce” its presence. Those nodes could pass this information along to their neighbors, etc (search “gossip protocols”)


Not directly related to the above, but an interesting comment about efficiency from :rpc.multicall:

https://github.com/erlang/otp/blob/12ca3da107281fe672b8b6f93f52c8556b66c218/lib/kernel/src/rpc.erl#L672-L679

Last Post!

Erynn

Erynn

thank you

Where Next?

Popular in Questions Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
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
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
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
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

Other popular topics Top

JeremM34
Hello, how can I check the Phoenix version ? Thanks !
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
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
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

We're in Beta

About us Mission Statement