How to deploy an upgrade (build with rebar3)

Loïc Hoguin essen@REDACTED
Mon Feb 24 15:28:39 CET 2020

On 24/02/2020 15:15, Fred Hebert wrote:> Another common pattern is going 
to see some servers die when their
> acceptor pool crashes for the same reasons -- the acceptors maintain a 
> reference to an older module, and following a couple of reloads, they 
> get killed all at once in a kind of storm. Ranch, which underpins 
> cowboy, is the most frequently seen one doing this as its acceptor pool 
> isn't safe (all accept calls wait for infinity 
> <>, 
> which as far as I can tell is a performance-based decision); a 
> workaround for this is to shrink your acceptor pool to be small enough 
> that you can reasonably expect all acceptors to be used between two 
> upgrades.

Ranch 2.0 onward fully supports upgrades and comes with an appup you can 
use directly:

We've recently added a test suite:

The workaround described is more or less what Ranch 2.0 does during the 
upgrade: stop all the acceptor processes, perform the upgrade, resume 
the acceptor processes. The listening socket(s) stays open, so no new 
connections should be rejected as long as the backlog is large enough, 
and existing connections stay alive as well.


Loïc Hoguin

More information about the erlang-questions mailing list