<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="295018" data-post-id="295018">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="aramallo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/aramallo/120/30171_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  aramallo
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>What I am definitively planning on doing is adding QUIC support for Partisan (echoing <a class="mention" href="/u/chasers" rel="nofollow">@chasers</a> mention of it)</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="295018" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/libcluster-intermittent-disconnects-what-can-i-configure-to-create-a-more-reliable-cluster/56645/32">Post #31</a>
	                </div>
	            </div>
              <div id="likers-container-295018" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="295018"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #31"></div>
  </section>
</div>
    <div class="postbit" id="295076" data-post-id="295076">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="max-au" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  max-au
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="hubertlepicki" data-post="27" data-topic="56645">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hubertlepicki/48/6822_2.png" class="avatar"> hubertlepicki:</div>
<blockquote>
<p>they gave up on the idea and the cluster as they currently have is a mostly standard Erlang distribution</p>
</blockquote>
</aside>
<p>I would not call it “gave up”. In fact it was a long process of explaining why maintaining a fork of Erlang distribution (and an OTP fork too) isn’t the best approach. On one side, it allows for quick hacks here and there - when we needed to change some distribution behaviour, we could easily do that.<br>
On the other side, it allowed for quick, dirty and ugly hacks that were only good for short-term PSC - “performance review” - goals. For real - "I drilled that many holes and short-circuited some things, breaking signal ordering guarantees, but I saved 3% CPU globally.<br>
Those unfortunate enough who wanted to work together with community, bring new OTP versions (not that easy with forks of everything!), fix bugs upstream instead of making local patches, were suffering the most. Often working nights when dirty hacks ruined servers.<br>
Thankfully, a strong engineering lead succeeded in pushing that project through.</p>
<p>Now, back to original question, Erlang distribution works best with reliable networks, with predictable latency and throughput. There are, indeed, a large number of options one could leverage to make it work better across the pond. Overseas, I’d say <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"><br>
But the first thing to do would be to understand what issues are actually there, and whether something could be done even outside of the BEAM. To begin with, I’d recommend collecting network statistics (which we meticulously did!). That includes, but not limited to, TCP retransmit counters, send and receive buffer sizes (and utilisation), disconnection reasons. Generally make the underlying network more reliable. This is relatively easy within one datacenter, but could be challenging otherwise.</p>
<p>When there is some statistics, and some understanding of what are the problems, and what are the causes, I could probably help with figuring our some configuration changes. One was already mentioned, net_kernel tick timer, but you may want to go further and have a <code>gen_server</code> that would periodically “ping” other nodes and collect latency statistics - and even <code>disconnect_node</code>/<code>connect_node</code> as a mitigation.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="295076" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/libcluster-intermittent-disconnects-what-can-i-configure-to-create-a-more-reliable-cluster/56645/33">Post #32</a>
	                </div>
	            </div>
              <div id="likers-container-295076" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="295076"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #32"></div>
  </section>
</div>
    <div class="postbit" id="295094" data-post-id="295094">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="hubertlepicki" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hubertlepicki/120/6822_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  hubertlepicki
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="max-au" data-post="33" data-topic="56645">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/m/dc4da7/48.png" class="avatar"> max-au:</div>
<blockquote>
<p>Generally make the underlying network more reliable. This is relatively easy within one datacenter, but could be challenging otherwise.</p>
</blockquote>
</aside>
<p>Thank you for your time, it’s very helpful.</p>
<p>This is precisely why I mentioned that it’s in the hands of public cloud maintainers or even more so in the hands of PAAS platforms like Gigalixir or <a href="http://Fly.io" rel="noopener nofollow ugc">Fly.io</a> to tweak their network infrastructure, which I hope they do. But things like <a href="http://Fly.io" rel="noopener nofollow ugc">Fly.io</a> from the very start push towards <em>a globally distributed</em> network of nodes, and I strongly suspect ensuring network reliability in this context is a task that will only become possible once we have some sort of quantum entanglement near-instantaneous communication between data centers - and not underwater cables connecting those nodes.</p>
<p>I am yet to try Parisan <a class="mention" href="/u/aramallo" rel="nofollow">@aramallo</a> and it looks like it is now actively developed and maintained, which is great. I had a look at it before but it didn’t seem to be the case. One thing I mentioned above would be great to have, however, is Partisan-based <code>Phoenix.PubSub</code> backend (<a href="https://hexdocs.pm/phoenix_pubsub/Phoenix.PubSub.html" class="inline-onebox" rel="noopener nofollow ugc">Phoenix.PubSub — Phoenix.PubSub v2.2.0</a>). This is often heavily used by Phoenix apps, both having LiveView UIs but also doing any sort of GraphQL/Subscription or other tasks, as a notification layer and currently there’s <code>pg</code> and <code>Redis</code> backend, and I think <code>pg</code> doesn’t work with Partisan (? <a href="https://erlangforums.com/t/partisan-high-performance-high-scalability-distributed-computing-with-erlang-and-elixir/1555/8" class="inline-onebox" rel="nofollow">Partisan - high-performance, high-scalability distributed computing with Erlang and Elixir - #8 by aramallo - Libraries - Erlang Programming Language Forum - Erlang Forums</a>). So obviously making <code>pg</code> work would make Phoenix.PubSub work, which then means that probably 90% of Phoenix apps can be switched over from either standard Erlang distribution clustering or Redis backend to Partisan, which would be very exciting, as I understand it’s designed to handle these sort of cloud networking infrastructure problems better than standard Erlang.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="295094" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/libcluster-intermittent-disconnects-what-can-i-configure-to-create-a-more-reliable-cluster/56645/34">Post #33</a>
	                </div>
	            </div>
              <div id="likers-container-295094" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="295094"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #33"></div>
  </section>
</div>
    <div class="postbit" id="295117" data-post-id="295117">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="benwilson512" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/benwilson512/120/1457_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  benwilson512
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Craft GraphQL APIs in Elixir with Absinthe</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="hubertlepicki" data-post="34" data-topic="56645">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hubertlepicki/48/6822_2.png" class="avatar"> hubertlepicki:</div>
<blockquote>
<p>So obviously making <code>pg</code> work would make Phoenix.PubSub work, which then means that probably 90% of Phoenix apps can be switched over from either standard Erlang distribution clustering or Redis backend to Partisan</p>
</blockquote>
</aside>
<p>Yes and no. Partisan does not make the network more reliable, it just handles a less reliable network with different trade offs. If your nodes are in fact not connected to one another, the Phoenix.PubSub paradigm flat won’t work, Partisan or not.</p>
<aside class="quote no-group" data-username="hubertlepicki" data-post="34" data-topic="56645">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hubertlepicki/48/6822_2.png" class="avatar"> hubertlepicki:</div>
<blockquote>
<p>But things like <a href="http://Fly.io" rel="nofollow">Fly.io</a> from the very start push towards <em>a globally distributed</em> network of nodes</p>
</blockquote>
</aside>
<p>Indeed, but there’s a big difference between having a globally distributed set of stateless nodes and a globally distributed set of stateful nodes. The latter is an incredibly hard problem. If you take an Erlang / Elixir process architecture designed for a local reliable network and you scale it out globally you’re going to have a bad time. You’re looking at really cutting edge stuff in any language.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="295117" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/libcluster-intermittent-disconnects-what-can-i-configure-to-create-a-more-reliable-cluster/56645/35">Post #34</a>
	                </div>
	            </div>
              <div id="likers-container-295117" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="295117"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #34"></div>
  </section>
</div>
    <div class="postbit" id="295308" data-post-id="295308">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="max-au" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  max-au
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="hubertlepicki" data-post="34" data-topic="56645">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hubertlepicki/48/6822_2.png" class="avatar"> hubertlepicki:</div>
<blockquote>
<p>I strongly suspect ensuring network reliability in this context is a task that will only become possible once we have some sort of quantum entanglement near-instantaneous communication</p>
</blockquote>
</aside>
<p>I’m afraid this applies to all programming languages and solutions. Agree with <a class="mention" href="/u/benwilson512" rel="nofollow">@benwilson512</a> that there could be an implementation with different tradeoffs. For example, forfeiting signal ordering guarantee with using non-synchronised UDP datagrams, which will alleviate packet loss. But complexity has to live somewhere - it is much harder to write software that does not rely on signal ordering.</p>
<p>Hence I’d think of defining a problem first. In most cases, disconnecting a node isn’t a problem per se, while lost redundancy (or consistency) caused by lost connectivity might be. Defining high-level metrics that need to stay below (or above) a certain treshold (e.g. “error ratio for read request”) could be the first step. It’s important to know what matters (e.g. user perceived latency) versus what is easy to observe (stream of log messages about disconnected nodes).<br>
In the absence of such metrics it’d be hard to know whether changing distribution carrier moved the needle in the right direction.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="295308" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/libcluster-intermittent-disconnects-what-can-i-configure-to-create-a-more-reliable-cluster/56645/36">Post #35</a>
	                </div>
	            </div>
              <div id="likers-container-295308" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="295308"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #35"></div>
  </section>
</div>
    <div class="postbit" id="295488" data-post-id="295488">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="low.sock" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  low.sock
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thanks everyone for your responses. Other things have taken my focus for a while but I’m focusing on getting as much as I can measurement wise. That way I can more confidently understand the configuration changes that I’m making and the (potential) impact on users. <img src="https://forum.elixirforum.com/images/emoji/apple/smiley.png?v=15" title=":smiley:" class="emoji" alt=":smiley:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="295488" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/libcluster-intermittent-disconnects-what-can-i-configure-to-create-a-more-reliable-cluster/56645/37">Post #36</a>
	                </div>
	            </div>
              <div id="likers-container-295488" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="295488"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #36"></div>
  </section>
</div>
    <div class="postbit" id="299349" data-post-id="299349">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="chasers" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/chasers/120/14188_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  chasers
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="low.sock" data-post="37" data-topic="56645">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/l/b487fb/48.png" class="avatar"> low.sock:</div>
<blockquote>
<p>but I’m focusing on getting as much as I can measurement wise</p>
</blockquote>
</aside>
<p>Relevant:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">:erlang.system_monitor(self(), [:busy_dist_port])
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="299349" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/libcluster-intermittent-disconnects-what-can-i-configure-to-create-a-more-reliable-cluster/56645/38">Post #37</a>
	                </div>
	            </div>
              <div id="likers-container-299349" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="299349"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>