low.sock
Libcluster intermittent disconnects - what can I configure to create a more reliable cluster?
Hi,
I’m currently running a Elixir application which leverages Phoenix channels. I’ve clustered my application together using libcluster but my application gets intermittent warnings about node disconnects. This is an example of the message that I’m getting:
[warning] ‘global’ at node :“app name@ip” disconnected node :“app name@ip” in order to prevent overlapping partitions
I have also had users raise issues about de-sync, which would make me believe that this is an issue.
I’ve deployed my application on Fly.io and it seems that the nodes that are farther from every other node disconnect more often. For instance, most of my servers are in North America and Europe but my node in South America disconnects quite frequently, with my node in Australia being a close second. I’m running 20 nodes in total.
Basically what my question boils down to is what can I do about this? Is there a configuration that would allow node to wait longer for a response from other nodes? I know there Erlang flags but I wanted to ask here first if those would be a good idea and how could I go about adding these on a Dockerfile (which Fly uses to deploy the application).
Sorry for the long post and any advice would be much appreciated ![]()
Edit: just fixed some formatting in the post
Most Liked
asabil
LostKobrakai
If you’re talking about pubsub then forking is not needed. Pubsub already supports adapters to use different backends. E.g. there’s a redis based backend for heroku users.
hst337
It appears that nodes just lose connection from time to time
This is what global source code says about it:
%% ----------------------------------------------------------------
%% Prevent Overlapping Partitions Algorithm
%% ========================================
%%
%% 1. When a node lose connection to another node it sends a
%% {lost_connection, LostConnNode, OtherNode} message to all
%% other nodes that it knows of.
%% 2. When a lost_connection message is received the receiver
%% first checks if it has seen this message before. If so, it
%% just ignores it. If it has not seen it before, it sends the
%% message to all nodes it knows of. This in order to ensure
%% that all connected nodes will receive this message. It then
%% sends a {remove_connection, LostConnRecvNode} message (where
%% LostConnRecvNode is its own node name) to OtherNode and
%% clear all information about OtherNode so OtherNode wont be
%% part of ReceiverNode's cluster anymore. When this information
%% has been cleared, no lost_connection will be triggered when
%% a nodedown message for the connection to OtherNode is
%% received.
%% 3. When a {remove_connection, LostConnRecvNode} message is
%% received, the receiver node takes down the connection to
%% LostConnRecvNode and clears its information about
%% LostConnRecvNode so it is not part of its cluster anymore.
%% Both nodes will receive a nodedown message due to the
%% connection being closed, but none of them will send
%% lost_connection messages since they have cleared information
%% about the other node.
%%
%% This will take down more connections than the minimum amount
%% of connections to remove in order to form fully connected
%% partitions. For example, if the user takes down a connection
%% between two nodes, the rest of the nodes will disconnect from
%% both of these nodes instead of just one. This is due to:
%% * We do not want to partition a remaining network when a node
%% has halted. When you receive a nodedown and/or lost_connection
%% messages you don't know if the corresponding node has halted
%% or if there are network issues.
%% * We need to decide which connection to take down as soon as
%% we receive a lost_connection message in order to prevent
%% inconsistencies entering global's state.
%% * All nodes need to make the same choices independent of
%% each other.
%%
%% ----------------------------------------------------------------
So, the real question is are you sure that the connection between nodes is not lost from time to time? If you’re sure, what tool do you use to check it?
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex









