diff options
author | Loïc Hoguin <[email protected]> | 2015-12-18 16:05:51 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2015-12-18 16:05:51 +0100 |
commit | ae8ff1fc0fcac71f24958962a362800775b43b41 (patch) | |
tree | f3fcc390d0bdd8096685ea2eeed4d4ea4cfe9ca6 /src | |
parent | cfb5386fafaa8ba75bb4720403e90b2581643f9f (diff) | |
download | ranch-ae8ff1fc0fcac71f24958962a362800775b43b41.tar.gz ranch-ae8ff1fc0fcac71f24958962a362800775b43b41.tar.bz2 ranch-ae8ff1fc0fcac71f24958962a362800775b43b41.zip |
Use the default restart intensity in all supervisors
This reduces from 10 restarts in 10 seconds to 1 restart
in 5 seconds. This is the new default in OTP 18, and it
fits the kinds of processes that Ranch deals with:
* Supervisors: default makes sense.
* Acceptors: they crash on socket error. They'll probably
crash again if the socket didn't change.
* Connection processes: they are never restarted.
Diffstat (limited to 'src')
-rw-r--r-- | src/ranch_acceptors_sup.erl | 2 | ||||
-rw-r--r-- | src/ranch_listener_sup.erl | 2 | ||||
-rw-r--r-- | src/ranch_sup.erl | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/ranch_acceptors_sup.erl b/src/ranch_acceptors_sup.erl index 2def6a1..497ccfe 100644 --- a/src/ranch_acceptors_sup.erl +++ b/src/ranch_acceptors_sup.erl @@ -46,7 +46,7 @@ init([Ref, NbAcceptors, Transport, TransOpts]) -> LSocket, Transport, ConnsSup ]}, permanent, brutal_kill, worker, []} || N <- lists:seq(1, NbAcceptors)], - {ok, {{one_for_one, 10, 10}, Procs}}. + {ok, {{one_for_one, 1, 5}, Procs}}. -spec listen_error(any(), module(), any(), atom()) -> no_return(). listen_error(Ref, Transport, TransOpts2, Reason) -> diff --git a/src/ranch_listener_sup.erl b/src/ranch_listener_sup.erl index a8c6676..294cd1d 100644 --- a/src/ranch_listener_sup.erl +++ b/src/ranch_listener_sup.erl @@ -39,4 +39,4 @@ init({Ref, NbAcceptors, Transport, TransOpts, Protocol}) -> [Ref, NbAcceptors, Transport, TransOpts]}, permanent, infinity, supervisor, [ranch_acceptors_sup]} ], - {ok, {{rest_for_one, 10, 10}, ChildSpecs}}. + {ok, {{rest_for_one, 1, 5}, ChildSpecs}}. diff --git a/src/ranch_sup.erl b/src/ranch_sup.erl index 2eb5680..e078fd7 100644 --- a/src/ranch_sup.erl +++ b/src/ranch_sup.erl @@ -29,4 +29,4 @@ init([]) -> {ranch_server, {ranch_server, start_link, []}, permanent, 5000, worker, [ranch_server]} ], - {ok, {{one_for_one, 10, 10}, Procs}}. + {ok, {{one_for_one, 1, 5}, Procs}}. |