diff options
author | Maria Scott <[email protected]> | 2021-09-07 11:42:49 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2021-09-07 12:27:39 +0200 |
commit | ad1dc0c538610bdaf5e7b197ca997820d4a3d348 (patch) | |
tree | 698cad56f4fdf951a6d77f9d4a5dd5e5c95b94cd /doc/src/guide | |
parent | f3bef7c456204ee653fafcfa53322daddf6e1c0e (diff) | |
download | ranch-ad1dc0c538610bdaf5e7b197ca997820d4a3d348.tar.gz ranch-ad1dc0c538610bdaf5e7b197ca997820d4a3d348.tar.bz2 ranch-ad1dc0c538610bdaf5e7b197ca997820d4a3d348.zip |
Manual for num_connection alarms
Diffstat (limited to 'doc/src/guide')
-rw-r--r-- | doc/src/guide/listeners.asciidoc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/doc/src/guide/listeners.asciidoc b/doc/src/guide/listeners.asciidoc index 4437143..0e94e45 100644 --- a/doc/src/guide/listeners.asciidoc +++ b/doc/src/guide/listeners.asciidoc @@ -330,7 +330,7 @@ processes. === Setting connection count alarms -The `alarms` transport options allows you to configure alarms +The `alarms` transport option allows you to configure alarms which will be triggered when the number of connections under a connection supervisor reaches or exceeds the defined treshold. @@ -340,7 +340,7 @@ options as values. Any term is allowed as an alarm name. Alarm options, defining the alarm behavior, are again a map with the following -keys, all of which are mandatory: +keys: `type`:: The alarm type. Currently, `num_connections` is the only allowed type. @@ -356,7 +356,7 @@ alarm is triggered. Its arguments are the listener name, the alarm name, the Pid of the triggering connection supervisor, and the Pids of all the connection processes under that supervisor. -`cooldown`:: +`cooldown` (5000):: The minimum time to elapse before the alarm can trigger again, in milliseconds. @@ -373,8 +373,7 @@ Alarms = #{ "Supervisor ~s of listener ~s " "has ~b connections", [Name, Ref, ConnSup, length(ConnPids)]) - end, - cooldown => 5000 + end } }, {ok, _} = ranch:start_listener(tcp_echo, @@ -386,8 +385,8 @@ Alarms = #{ In the example code, an alarm named `my_alarm` is defined, which will call the given function when the number of connections under a connection supervisor reaches or exceeds 100. When the number of -connections is still (or again) above 100 after 5 seconds, the -alarm will trigger again. +connections is still (or again) above 100 after the default cooldown +period of 5 seconds, the alarm will trigger again. === When running out of file descriptors |