low.sock
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
Trending in Questions
Other Trending 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
- #blog-post
- #phoenix_html
- #iex
- #graphql
- #ai
- #genstage
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










Showing Posts 1 to 10- Show Best Posts
- Show All Posts (oldest first)
- Show All Posts (newest first)
benwilson512
It is my understanding that distributed erlang is not really built for geographically distributed clusters by default. These connections are not (as you have observed) the most reliable, and this leads to partitioning and other problematic behavior.
This seems pretty high, can you talk about the load that you see?
asabil
Did you check
net_ticktime: https://www.erlang.org/doc/man/kernel_app.html#net_ticktimelow.sock
So would Redis clustering be the way to go?
I have 20 nodes because Fly doesn’t have auto-scaling for their Apps v2 platform, you have to pre-allocate your machines
low.sock
Cool, would this configured inside the runtime file in the Elixir app?
asabil
Yes, something like this should work:
low.sock
Thanks, I did try that but I get the following:
I’m going to try and set it through the vm.args.eex file. Is there a command I can use with iex to check the net_ticktime? I’ve been doing some searching but nothing is jumping out at me
hst337
It appears that nodes just lose connection from time to time
This is what
globalsource code says about it: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?
schneebyte
If you don’t need global then i would set
prevent_overlapping_partitionstofalsehttps://www.erlang.org/doc/man/kernel_app.html#prevent_overlapping_partitionsAnd depending on how many messages you’re sending between nodes you might want to increase the distribution buffer busy limit as well, default is only 1 MB
Also
net_setuptimehttps://www.erlang.org/doc/man/kernel_app.html#net_setuptimeYou can use
Application.get_env(:kernel, :net_ticktime)to check the value.low.sock
Thanks everyone for the tips. I’m testing the different configurations and adding a little more monitoring so I can more easily see improvements. I’ll update again once I’ve seen some improvements
chasers
Also very interested in the ideal global config.
We see a lot of packet loss between regions on Fly depending on the region and have managed to only get 4 regions (8 nodes) running somewhat reliably.
Had to build latency monitoring. See: Realtime Status
It logs latencies to our logging infra too if they are over a threshold.
Note: the default PubSub adapter sends all messages to all nodes.
The Redis adapter would route everything through one box which would negate the whole global cluster idea.