erldns_listeners (erldns v7.0.0-rc5)
View SourceDNS listeners configuration.
In order to configure, add to the application environment:
{erldns, [
{listeners, [
#{name => Name, transport => Protocol, ip => IP, port => Port, parallel_factor => PFactor}
]}
]}
See the type config/0
for details.
Telemetry events
Emits the following telemetry events:
[erldns, request, start]
- Measurements:
monotonic_time := integer() request_size := non_neg_integer()
- Metadata:
transport := udp | tcp
[erldns, request, stop]
- Measurements:
monotonic_time := integer() duration := non_neg_integer() response_size := non_neg_integer()
- Metadata:
transport := udp | tcp dnssec := boolean()
[erldns, request, error]
- Measurements:
count := non_neg_integer()
- Metadata:
transport := udp | tcp kind => exit | error | throw reason => term() stacktrace => [term()]
[erldns, request, timeout]
- Measurements:
count := non_neg_integer()
- Metadata:
transport := udp | tcp
Summary
Types
Configuration map for a listener.
Name of the listener, a required parameter.
A multiplying factor for parallelisation.
Statistics about each listener.
TCP or UDP, or both. Default is both
Functions
Get statistics about all listeners.
Types
-type config() :: #{name := name(), transport => transport(), ip => inet:ip_address() | string() | any, port => inet:port_number(), parallel_factor => parallel_factor()}.
Configuration map for a listener.
It can contain the following keys:
Name
is any desired name in the form of an atom,IP
isany
, in which case it will listen on all interfaces, or a valid ip address in tuple or string format. Default isany
.Port
is a valid port number. Default is53
.Protocol
is eithertcp
orudp
, orboth
. Default isboth
.
-type name() :: atom().
Name of the listener, a required parameter.
-type parallel_factor() :: 1..512.
A multiplying factor for parallelisation.
The number of schedulers is multiplied by this factor when creating worker pools.
By default, it is 1
. The number of TCP and UDP acceptors will be of this size,
while the number of UDP workers will be 4x and the maximum number of TCP workers will be 1024x.
Note that the UDP pool is static, while the TCP pool is dynamic.
See wpool
and ranch
respectively for details.
-type stats() :: #{{name(), tcp | udp} => #{queue_length := non_neg_integer()}}.
Statistics about each listener.
-type transport() :: tcp | udp | both.
TCP or UDP, or both. Default is both
Functions
-spec get_stats() -> stats().
Get statistics about all listeners.