|
|
@@ -344,8 +344,8 @@ log {
|
|
|
##
|
|
|
## @doc log.console_handler.level
|
|
|
## ValueType: debug | info | notice | warning | error | critical | alert | emergency
|
|
|
- ## Default: debug
|
|
|
- console_handler.level = debug
|
|
|
+ ## Default: warning
|
|
|
+ console_handler.level = warning
|
|
|
|
|
|
##----------------------------------------------------------------
|
|
|
## The file log handlers send log messages to files
|
|
|
@@ -358,8 +358,8 @@ log {
|
|
|
##
|
|
|
## @doc log.file_handlers.<name>.level
|
|
|
## ValueType: debug | info | notice | warning | error | critical | alert | emergency
|
|
|
- ## Default: debug
|
|
|
- level: debug
|
|
|
+ ## Default: warning
|
|
|
+ level: warning
|
|
|
|
|
|
## The log file for specified level.
|
|
|
##
|
|
|
@@ -380,18 +380,18 @@ log {
|
|
|
## With this enabled, new log files will be created when the current
|
|
|
## log file is full, max to `rotation_count` files will be created.
|
|
|
##
|
|
|
- ## @doc log.file_handlers.<name>.rotation
|
|
|
+ ## @doc log.file_handlers.<name>.rotation.enable
|
|
|
## ValueType: Boolean
|
|
|
## Default: true
|
|
|
- rotation = true
|
|
|
+ rotation.enable = true
|
|
|
|
|
|
## Maximum rotation count of log files.
|
|
|
##
|
|
|
- ## @doc log.file_handlers.<name>.rotation_count
|
|
|
+ ## @doc log.file_handlers.<name>.rotation.count
|
|
|
## ValueType: Integer
|
|
|
## Range: [1, 2048]
|
|
|
## Default: 10
|
|
|
- rotation_count: 10
|
|
|
+ rotation.count: 10
|
|
|
|
|
|
## Maximum size of each log file.
|
|
|
##
|
|
|
@@ -411,9 +411,19 @@ log {
|
|
|
## log level for example:
|
|
|
file_handlers.emqx_error: {
|
|
|
level: error
|
|
|
- file: "{{ platform_log_dir }}/emqx.error.log"
|
|
|
+ file: "{{ platform_log_dir }}/error.log"
|
|
|
}
|
|
|
|
|
|
+ ## Timezone offset to display in logs
|
|
|
+ ##
|
|
|
+ ## @doc log.time_offset
|
|
|
+ ## ValueType: system | utc | String
|
|
|
+ ## - "system" use system zone
|
|
|
+ ## - "utc" for Universal Coordinated Time (UTC)
|
|
|
+ ## - "+hh:mm" or "-hh:mm" for a specified offset
|
|
|
+ ## Default: system
|
|
|
+ time_offset = system
|
|
|
+
|
|
|
## Limits the total number of characters printed for each log event.
|
|
|
##
|
|
|
## @doc log.chars_limit
|
|
|
@@ -421,6 +431,14 @@ log {
|
|
|
## Default: infinity
|
|
|
chars_limit: 8192
|
|
|
|
|
|
+ ## Maximum depth for Erlang term log formatting
|
|
|
+ ## and Erlang process message queue inspection.
|
|
|
+ ##
|
|
|
+ ## @doc log.max_depth
|
|
|
+ ## ValueType: Integer | infinity
|
|
|
+ ## Default: 80
|
|
|
+ max_depth = 80
|
|
|
+
|
|
|
## Log formatter
|
|
|
## @doc log.formatter
|
|
|
## ValueType: text | json
|
|
|
@@ -477,10 +495,10 @@ log {
|
|
|
## We could kill the log handler in these cases and restart it after a
|
|
|
## few seconds.
|
|
|
##
|
|
|
- ## @doc log.overload_kill
|
|
|
+ ## @doc log.overload_kill.enable
|
|
|
## ValueType: Boolean
|
|
|
## Default: true
|
|
|
- overload_kill: true
|
|
|
+ overload_kill.enable: true
|
|
|
|
|
|
## The max allowed queue length before killing the log hanlder.
|
|
|
##
|
|
|
@@ -488,11 +506,11 @@ log {
|
|
|
## length. If the message queue grows larger than this, the handler
|
|
|
## process is terminated.
|
|
|
##
|
|
|
- ## @doc log.overload_kill_qlen
|
|
|
+ ## @doc log.overload_kill.qlen
|
|
|
## ValueType: Integer
|
|
|
## Range: [0, 1048576]
|
|
|
## Default: 20000
|
|
|
- overload_kill_qlen: 20000
|
|
|
+ overload_kill.qlen: 20000
|
|
|
|
|
|
## The max allowed memory size before killing the log hanlder.
|
|
|
##
|
|
|
@@ -500,20 +518,20 @@ log {
|
|
|
## that the handler process is allowed to use. If the handler grows
|
|
|
## larger than this, the process is terminated.
|
|
|
##
|
|
|
- ## @doc log.overload_kill_mem_size
|
|
|
+ ## @doc log.overload_kill.mem_size
|
|
|
## ValueType: Size
|
|
|
## Default: 30MB
|
|
|
- overload_kill_mem_size: 30MB
|
|
|
+ overload_kill.mem_size: 30MB
|
|
|
|
|
|
## Restart the log hanlder after some seconds.
|
|
|
##
|
|
|
## Log overload protection parameter. If the handler is terminated,
|
|
|
## it restarts automatically after a delay specified in seconds.
|
|
|
##
|
|
|
- ## @doc log.overload_kill_restart_after
|
|
|
+ ## @doc log.overload_kill.restart_after
|
|
|
## ValueType: Duration
|
|
|
## Default: 5s
|
|
|
- overload_kill_restart_after: 5s
|
|
|
+ overload_kill.restart_after: 5s
|
|
|
|
|
|
## Controlling Bursts of Log Requests.
|
|
|
##
|
|
|
@@ -526,26 +544,26 @@ log {
|
|
|
## Note that there would be no warning if any messages were
|
|
|
## dropped because of burst control.
|
|
|
##
|
|
|
- ## @doc log.burst_limit
|
|
|
+ ## @doc log.burst_limit.enable
|
|
|
## ValueType: Boolean
|
|
|
## Default: false
|
|
|
- burst_limit: false
|
|
|
+ burst_limit.enable: false
|
|
|
|
|
|
## This config controls the maximum number of events to handle within
|
|
|
## a time frame. After the limit is reached, successive events are
|
|
|
## dropped until the end of the time frame defined by `window_time`.
|
|
|
##
|
|
|
- ## @doc log.burst_limit_max_count
|
|
|
+ ## @doc log.burst_limit.max_count
|
|
|
## ValueType: Integer
|
|
|
## Default: 10000
|
|
|
- burst_limit_max_count: 10000
|
|
|
+ burst_limit.max_count: 10000
|
|
|
|
|
|
## See the previous description of burst_limit_max_count.
|
|
|
##
|
|
|
- ## @doc log.burst_limit_window_time
|
|
|
+ ## @doc log.burst_limit.window_time
|
|
|
## ValueType: duration
|
|
|
## Default: 1s
|
|
|
- burst_limit_window_time: 1s
|
|
|
+ burst_limit.window_time: 1s
|
|
|
}
|
|
|
|
|
|
##==================================================================
|
|
|
@@ -577,8 +595,7 @@ rpc {
|
|
|
##
|
|
|
## @doc cluster.discovery_strategy
|
|
|
## ValueType: manual | stateless
|
|
|
- ## - manual: discover ports by `tcp_server_port` and
|
|
|
- ## `tcp_client_port`.
|
|
|
+ ## - manual: discover ports by `tcp_server_port`.
|
|
|
## - stateless: discover ports in a stateless manner.
|
|
|
## If node name is `emqx<N>@127.0.0.1`, where the `<N>` is
|
|
|
## an integer, then the listening port will be `5370 + <N>`
|
|
|
@@ -596,26 +613,15 @@ rpc {
|
|
|
## Defaults: 5369
|
|
|
tcp_server_port: 5369
|
|
|
|
|
|
- ## TCP port for outgoing RPC connections.
|
|
|
- ##
|
|
|
- ## Only takes effect when `rpc.port_discovery` = `manual`.
|
|
|
- ##
|
|
|
- ## @doc rpc.tcp_client_port
|
|
|
- ## ValueType: Integer
|
|
|
- ## Range: [1024-65535]
|
|
|
- ## Defaults: 5369
|
|
|
- tcp_client_port: 5369
|
|
|
-
|
|
|
## Number of outgoing RPC connections.
|
|
|
##
|
|
|
- ## Defaults to "num_cpu_cores", that is, the number of CPU cores.
|
|
|
## Set this to 1 to keep the message order sent from the same
|
|
|
## client.
|
|
|
##
|
|
|
## @doc rpc.tcp_client_num
|
|
|
- ## ValueType: Integer | num_cpu_cores
|
|
|
+ ## ValueType: Integer
|
|
|
## Range: [1, 256]
|
|
|
- ## Defaults: num_cpu_cores
|
|
|
+ ## Defaults: 1
|
|
|
tcp_client_num: 1
|
|
|
|
|
|
## RCP Client connect timeout.
|
|
|
@@ -827,6 +833,13 @@ zone.default {
|
|
|
## Default: true
|
|
|
stats.enable: true
|
|
|
|
|
|
+ ## Maximum number of concurrent connections.
|
|
|
+ ##
|
|
|
+ ## @doc zone.<name>.listeners.<name>.overall_max_connections
|
|
|
+ ## ValueType: Number | infinity
|
|
|
+ ## Default: infinity
|
|
|
+ overall_max_connections: infinity
|
|
|
+
|
|
|
mqtt {
|
|
|
## When publishing or subscribing, prefix all topics with a mountpoint string.
|
|
|
## The prefixed string will be removed from the topic name when the message
|
|
|
@@ -870,7 +883,7 @@ zone.default {
|
|
|
## Maximum length of MQTT clientId allowed.
|
|
|
##
|
|
|
## @doc zone.<name>.mqtt.max_clientid_len
|
|
|
- ## ValueType: Integer | infinity
|
|
|
+ ## ValueType: Integer
|
|
|
## Range: [23, 65535]
|
|
|
## Default: 65535
|
|
|
max_clientid_len: 65535
|
|
|
@@ -878,10 +891,10 @@ zone.default {
|
|
|
## Maximum topic levels allowed.
|
|
|
##
|
|
|
## @doc zone.<name>.mqtt.max_topic_levels
|
|
|
- ## ValueType: Integer | infinity
|
|
|
+ ## ValueType: Integer
|
|
|
## Range: [1, 65535]
|
|
|
- ## Default: infinity
|
|
|
- max_topic_levels: infinity
|
|
|
+ ## Default: 65535
|
|
|
+ max_topic_levels: 65535
|
|
|
|
|
|
## Maximum QoS allowed.
|
|
|
##
|
|
|
@@ -893,7 +906,7 @@ zone.default {
|
|
|
## Maximum Topic Alias, 0 means no topic alias supported.
|
|
|
##
|
|
|
## @doc zone.<name>.mqtt.max_topic_alias
|
|
|
- ## ValueType: Integer | infinity
|
|
|
+ ## ValueType: Integer
|
|
|
## Range: [0, 65535]
|
|
|
## Default: 65535
|
|
|
max_topic_alias: 65535
|
|
|
@@ -958,11 +971,11 @@ zone.default {
|
|
|
## Default: 0.75
|
|
|
keepalive_backoff: 0.75
|
|
|
|
|
|
- ## Maximum number of subscriptions allowed, 0 means no limit.
|
|
|
+ ## Maximum number of subscriptions allowed.
|
|
|
##
|
|
|
## @doc zone.<name>.mqtt.max_subscriptions
|
|
|
## ValueType: Integer | infinity
|
|
|
- ## Range: [0, )
|
|
|
+ ## Range: [1, )
|
|
|
## Default: infinity
|
|
|
max_subscriptions: infinity
|
|
|
|
|
|
@@ -976,8 +989,8 @@ zone.default {
|
|
|
## Maximum size of the Inflight Window storing QoS1/2 messages delivered but unacked.
|
|
|
##
|
|
|
## @doc zone.<name>.mqtt.max_inflight
|
|
|
- ## ValueType: Integer | infinity
|
|
|
- ## Range: [0, )
|
|
|
+ ## ValueType: Integer
|
|
|
+ ## Range: [1, 65535]
|
|
|
## Default: 32
|
|
|
max_inflight: 32
|
|
|
|
|
|
@@ -988,11 +1001,11 @@ zone.default {
|
|
|
## Default: 30s
|
|
|
retry_interval: 30s
|
|
|
|
|
|
- ## Maximum QoS2 packets (Client -> Broker) awaiting PUBREL, 0 means no limit.
|
|
|
+ ## Maximum QoS2 packets (Client -> Broker) awaiting PUBREL.
|
|
|
##
|
|
|
## @doc zone.<name>.mqtt.max_awaiting_rel
|
|
|
## ValueType: Integer | infinity
|
|
|
- ## Range: [0, )
|
|
|
+ ## Range: [1, )
|
|
|
## Default: 100
|
|
|
max_awaiting_rel: 100
|
|
|
|
|
|
@@ -1011,7 +1024,7 @@ zone.default {
|
|
|
session_expiry_interval: 2h
|
|
|
|
|
|
## Maximum queue length. Enqueued messages when persistent client disconnected,
|
|
|
- ## or inflight window is full. 0 means no limit.
|
|
|
+ ## or inflight window is full.
|
|
|
##
|
|
|
## @doc zone.<name>.mqtt.max_mqueue_len
|
|
|
## ValueType: Integer | infinity
|
|
|
@@ -1117,61 +1130,6 @@ zone.default {
|
|
|
cache.ttl: 1m
|
|
|
}
|
|
|
|
|
|
- rate_limit {
|
|
|
- ## Maximum connections per second.
|
|
|
- ##
|
|
|
- ## @doc zone.<name>.max_conn_rate
|
|
|
- ## ValueType: Number | infinity
|
|
|
- ## Default: 1000
|
|
|
- ## Examples:
|
|
|
- ## max_conn_rate: 1000
|
|
|
- max_conn_rate: 1000
|
|
|
-
|
|
|
- ## Message limit for the a external MQTT connection.
|
|
|
- ##
|
|
|
- ## @doc zone.<name>.rate_limit.conn_messages_in
|
|
|
- ## ValueType: String | infinity
|
|
|
- ## Default: infinity
|
|
|
- ## Examples: 100 messages per 10 seconds.
|
|
|
- ## conn_messages_in: "100,10s"
|
|
|
- conn_messages_in: "100,10s"
|
|
|
-
|
|
|
- ## Limit the rate of receiving packets for a MQTT connection.
|
|
|
- ## The rate is counted by bytes of packets per second.
|
|
|
- ##
|
|
|
- ## The connection won't accept more messages if the messages come
|
|
|
- ## faster than the limit.
|
|
|
- ##
|
|
|
- ## @doc zone.<name>.rate_limit.conn_bytes_in
|
|
|
- ## ValueType: String | infinity
|
|
|
- ## Default: infinity
|
|
|
- ## Examples: 100KB incoming per 10 seconds.
|
|
|
- ## conn_bytes_in: "100KB,10s"
|
|
|
- ##
|
|
|
- conn_bytes_in: "100KB,10s"
|
|
|
-
|
|
|
- ## Messages quota for the each of external MQTT connection.
|
|
|
- ## This value consumed by the number of recipient on a message.
|
|
|
- ##
|
|
|
- ## @doc zone.<name>.rate_limit.quota.conn_messages_routing
|
|
|
- ## ValueType: String | infinity
|
|
|
- ## Default: infinity
|
|
|
- ## Examples: 100 messaegs per 1s:
|
|
|
- ## quota.conn_messages_routing: "100,1s"
|
|
|
- quota.conn_messages_routing: "100,1s"
|
|
|
-
|
|
|
- ## Messages quota for the all of external MQTT connections.
|
|
|
- ## This value consumed by the number of recipient on a message.
|
|
|
- ##
|
|
|
- ## @doc zone.<name>.rate_limit.quota.overall_messages_routing
|
|
|
- ## ValueType: String | infinity
|
|
|
- ## Default: infinity
|
|
|
- ## Examples: 200000 messages per 1s:
|
|
|
- ## quota.overall_messages_routing: "200000,1s"
|
|
|
- ##
|
|
|
- quota.overall_messages_routing: "200000,1s"
|
|
|
- }
|
|
|
-
|
|
|
flapping_detect {
|
|
|
## Enable Flapping Detection.
|
|
|
##
|
|
|
@@ -1299,11 +1257,9 @@ zone.default {
|
|
|
## The type of the listener.
|
|
|
##
|
|
|
## @doc zone.<name>.listeners.<name>.type
|
|
|
- ## ValueType: tcp | ssl | ws | wss
|
|
|
+ ## ValueType: tcp | ws
|
|
|
## - tcp: MQTT over TCP
|
|
|
- ## - ssl: MQTT over TLS
|
|
|
## - ws: MQTT over Websocket
|
|
|
- ## - wss: MQTT over WebSocket Secure
|
|
|
## Required: true
|
|
|
type: tcp
|
|
|
|
|
|
@@ -1318,9 +1274,9 @@ zone.default {
|
|
|
## The size of the acceptor pool for this listener.
|
|
|
##
|
|
|
## @doc zone.<name>.listeners.<name>.acceptors
|
|
|
- ## ValueType: Number | num_cpu_cores
|
|
|
- ## Default: num_cpu_cores
|
|
|
- acceptors: num_cpu_cores
|
|
|
+ ## ValueType: Number
|
|
|
+ ## Default: 16
|
|
|
+ acceptors: 16
|
|
|
|
|
|
## Maximum number of concurrent connections.
|
|
|
##
|
|
|
@@ -1363,6 +1319,61 @@ zone.default {
|
|
|
## Default: 3s
|
|
|
proxy_protocol_timeout: 3s
|
|
|
|
|
|
+ rate_limit {
|
|
|
+ ## Maximum connections per second.
|
|
|
+ ##
|
|
|
+ ## @doc zone.<name>.max_conn_rate
|
|
|
+ ## ValueType: Number | infinity
|
|
|
+ ## Default: 1000
|
|
|
+ ## Examples:
|
|
|
+ ## max_conn_rate: 1000
|
|
|
+ max_conn_rate: 1000
|
|
|
+
|
|
|
+ ## Message limit for the a external MQTT connection.
|
|
|
+ ##
|
|
|
+ ## @doc zone.<name>.rate_limit.conn_messages_in
|
|
|
+ ## ValueType: String | infinity
|
|
|
+ ## Default: infinity
|
|
|
+ ## Examples: 100 messages per 10 seconds.
|
|
|
+ ## conn_messages_in: "100,10s"
|
|
|
+ conn_messages_in: "100,10s"
|
|
|
+
|
|
|
+ ## Limit the rate of receiving packets for a MQTT connection.
|
|
|
+ ## The rate is counted by bytes of packets per second.
|
|
|
+ ##
|
|
|
+ ## The connection won't accept more messages if the messages come
|
|
|
+ ## faster than the limit.
|
|
|
+ ##
|
|
|
+ ## @doc zone.<name>.rate_limit.conn_bytes_in
|
|
|
+ ## ValueType: String | infinity
|
|
|
+ ## Default: infinity
|
|
|
+ ## Examples: 100KB incoming per 10 seconds.
|
|
|
+ ## conn_bytes_in: "100KB,10s"
|
|
|
+ ##
|
|
|
+ conn_bytes_in: "100KB,10s"
|
|
|
+
|
|
|
+ ## Messages quota for the each of external MQTT connection.
|
|
|
+ ## This value consumed by the number of recipient on a message.
|
|
|
+ ##
|
|
|
+ ## @doc zone.<name>.rate_limit.quota.conn_messages_routing
|
|
|
+ ## ValueType: String | infinity
|
|
|
+ ## Default: infinity
|
|
|
+ ## Examples: 100 messaegs per 1s:
|
|
|
+ ## quota.conn_messages_routing: "100,1s"
|
|
|
+ quota.conn_messages_routing: "100,1s"
|
|
|
+
|
|
|
+ ## Messages quota for the all of external MQTT connections.
|
|
|
+ ## This value consumed by the number of recipient on a message.
|
|
|
+ ##
|
|
|
+ ## @doc zone.<name>.rate_limit.quota.overall_messages_routing
|
|
|
+ ## ValueType: String | infinity
|
|
|
+ ## Default: infinity
|
|
|
+ ## Examples: 200000 messages per 1s:
|
|
|
+ ## quota.overall_messages_routing: "200000,1s"
|
|
|
+ ##
|
|
|
+ quota.overall_messages_routing: "200000,1s"
|
|
|
+ }
|
|
|
+
|
|
|
## TCP options
|
|
|
## See ${example_common_tcp_options} for more information
|
|
|
tcp.backlog: 1024
|
|
|
@@ -1377,13 +1388,11 @@ zone.default {
|
|
|
## The type of the listener.
|
|
|
##
|
|
|
## @doc zone.<name>.listeners.<name>.type
|
|
|
- ## ValueType: tcp | ssl | ws | wss
|
|
|
+ ## ValueType: tcp | ws
|
|
|
## - tcp: MQTT over TCP
|
|
|
- ## - ssl: MQTT over TLS
|
|
|
## - ws: MQTT over Websocket
|
|
|
- ## - wss: MQTT over WebSocket Secure
|
|
|
## Required: true
|
|
|
- type: ssl
|
|
|
+ type: tcp
|
|
|
|
|
|
## The IP address and port that the listener will bind.
|
|
|
##
|
|
|
@@ -1396,9 +1405,9 @@ zone.default {
|
|
|
## The size of the acceptor pool for this listener.
|
|
|
##
|
|
|
## @doc zone.<name>.listeners.<name>.acceptors
|
|
|
- ## ValueType: Number | num_cpu_cores
|
|
|
- ## Default: num_cpu_cores
|
|
|
- acceptors: num_cpu_cores
|
|
|
+ ## ValueType: Number
|
|
|
+ ## Default: 16
|
|
|
+ acceptors: 16
|
|
|
|
|
|
## Maximum number of concurrent connections.
|
|
|
##
|
|
|
@@ -1441,8 +1450,64 @@ zone.default {
|
|
|
## Default: 3s
|
|
|
proxy_protocol_timeout: 3s
|
|
|
|
|
|
+ rate_limit {
|
|
|
+ ## Maximum connections per second.
|
|
|
+ ##
|
|
|
+ ## @doc zone.<name>.max_conn_rate
|
|
|
+ ## ValueType: Number | infinity
|
|
|
+ ## Default: 1000
|
|
|
+ ## Examples:
|
|
|
+ ## max_conn_rate: 1000
|
|
|
+ max_conn_rate: 1000
|
|
|
+
|
|
|
+ ## Message limit for the a external MQTT connection.
|
|
|
+ ##
|
|
|
+ ## @doc zone.<name>.rate_limit.conn_messages_in
|
|
|
+ ## ValueType: String | infinity
|
|
|
+ ## Default: infinity
|
|
|
+ ## Examples: 100 messages per 10 seconds.
|
|
|
+ ## conn_messages_in: "100,10s"
|
|
|
+ conn_messages_in: "100,10s"
|
|
|
+
|
|
|
+ ## Limit the rate of receiving packets for a MQTT connection.
|
|
|
+ ## The rate is counted by bytes of packets per second.
|
|
|
+ ##
|
|
|
+ ## The connection won't accept more messages if the messages come
|
|
|
+ ## faster than the limit.
|
|
|
+ ##
|
|
|
+ ## @doc zone.<name>.rate_limit.conn_bytes_in
|
|
|
+ ## ValueType: String | infinity
|
|
|
+ ## Default: infinity
|
|
|
+ ## Examples: 100KB incoming per 10 seconds.
|
|
|
+ ## conn_bytes_in: "100KB,10s"
|
|
|
+ ##
|
|
|
+ conn_bytes_in: "100KB,10s"
|
|
|
+
|
|
|
+ ## Messages quota for the each of external MQTT connection.
|
|
|
+ ## This value consumed by the number of recipient on a message.
|
|
|
+ ##
|
|
|
+ ## @doc zone.<name>.rate_limit.quota.conn_messages_routing
|
|
|
+ ## ValueType: String | infinity
|
|
|
+ ## Default: infinity
|
|
|
+ ## Examples: 100 messaegs per 1s:
|
|
|
+ ## quota.conn_messages_routing: "100,1s"
|
|
|
+ quota.conn_messages_routing: "100,1s"
|
|
|
+
|
|
|
+ ## Messages quota for the all of external MQTT connections.
|
|
|
+ ## This value consumed by the number of recipient on a message.
|
|
|
+ ##
|
|
|
+ ## @doc zone.<name>.rate_limit.quota.overall_messages_routing
|
|
|
+ ## ValueType: String | infinity
|
|
|
+ ## Default: infinity
|
|
|
+ ## Examples: 200000 messages per 1s:
|
|
|
+ ## quota.overall_messages_routing: "200000,1s"
|
|
|
+ ##
|
|
|
+ quota.overall_messages_routing: "200000,1s"
|
|
|
+ }
|
|
|
+
|
|
|
## SSL options
|
|
|
## See ${example_common_ssl_options} for more information
|
|
|
+ ssl.enable: true
|
|
|
ssl.keyfile: "{{ platform_etc_dir }}/certs/key.pem"
|
|
|
ssl.certfile: "{{ platform_etc_dir }}/certs/cert.pem"
|
|
|
ssl.cacertfile: "{{ platform_etc_dir }}/certs/cacert.pem"
|
|
|
@@ -1460,11 +1525,9 @@ zone.default {
|
|
|
## The type of the listener.
|
|
|
##
|
|
|
## @doc zone.<name>.listeners.<name>.type
|
|
|
- ## ValueType: tcp | ssl | ws | wss
|
|
|
+ ## ValueType: tcp | ws
|
|
|
## - tcp: MQTT over TCP
|
|
|
- ## - ssl: MQTT over TLS
|
|
|
## - ws: MQTT over Websocket
|
|
|
- ## - wss: MQTT over WebSocket Secure
|
|
|
## Required: true
|
|
|
type: ws
|
|
|
|
|
|
@@ -1479,9 +1542,9 @@ zone.default {
|
|
|
## The size of the acceptor pool for this listener.
|
|
|
##
|
|
|
## @doc zone.<name>.listeners.<name>.acceptors
|
|
|
- ## ValueType: Number | num_cpu_cores
|
|
|
- ## Default: num_cpu_cores
|
|
|
- acceptors: num_cpu_cores
|
|
|
+ ## ValueType: Number
|
|
|
+ ## Default: 16
|
|
|
+ acceptors: 16
|
|
|
|
|
|
## Maximum number of concurrent connections.
|
|
|
##
|
|
|
@@ -1524,6 +1587,61 @@ zone.default {
|
|
|
## Default: 3s
|
|
|
proxy_protocol_timeout: 3s
|
|
|
|
|
|
+ rate_limit {
|
|
|
+ ## Maximum connections per second.
|
|
|
+ ##
|
|
|
+ ## @doc zone.<name>.max_conn_rate
|
|
|
+ ## ValueType: Number | infinity
|
|
|
+ ## Default: 1000
|
|
|
+ ## Examples:
|
|
|
+ ## max_conn_rate: 1000
|
|
|
+ max_conn_rate: 1000
|
|
|
+
|
|
|
+ ## Message limit for the a external MQTT connection.
|
|
|
+ ##
|
|
|
+ ## @doc zone.<name>.rate_limit.conn_messages_in
|
|
|
+ ## ValueType: String | infinity
|
|
|
+ ## Default: infinity
|
|
|
+ ## Examples: 100 messages per 10 seconds.
|
|
|
+ ## conn_messages_in: "100,10s"
|
|
|
+ conn_messages_in: "100,10s"
|
|
|
+
|
|
|
+ ## Limit the rate of receiving packets for a MQTT connection.
|
|
|
+ ## The rate is counted by bytes of packets per second.
|
|
|
+ ##
|
|
|
+ ## The connection won't accept more messages if the messages come
|
|
|
+ ## faster than the limit.
|
|
|
+ ##
|
|
|
+ ## @doc zone.<name>.rate_limit.conn_bytes_in
|
|
|
+ ## ValueType: String | infinity
|
|
|
+ ## Default: infinity
|
|
|
+ ## Examples: 100KB incoming per 10 seconds.
|
|
|
+ ## conn_bytes_in: "100KB,10s"
|
|
|
+ ##
|
|
|
+ conn_bytes_in: "100KB,10s"
|
|
|
+
|
|
|
+ ## Messages quota for the each of external MQTT connection.
|
|
|
+ ## This value consumed by the number of recipient on a message.
|
|
|
+ ##
|
|
|
+ ## @doc zone.<name>.rate_limit.quota.conn_messages_routing
|
|
|
+ ## ValueType: String | infinity
|
|
|
+ ## Default: infinity
|
|
|
+ ## Examples: 100 messaegs per 1s:
|
|
|
+ ## quota.conn_messages_routing: "100,1s"
|
|
|
+ quota.conn_messages_routing: "100,1s"
|
|
|
+
|
|
|
+ ## Messages quota for the all of external MQTT connections.
|
|
|
+ ## This value consumed by the number of recipient on a message.
|
|
|
+ ##
|
|
|
+ ## @doc zone.<name>.rate_limit.quota.overall_messages_routing
|
|
|
+ ## ValueType: String | infinity
|
|
|
+ ## Default: infinity
|
|
|
+ ## Examples: 200000 messages per 1s:
|
|
|
+ ## quota.overall_messages_routing: "200000,1s"
|
|
|
+ ##
|
|
|
+ quota.overall_messages_routing: "200000,1s"
|
|
|
+ }
|
|
|
+
|
|
|
## TCP options
|
|
|
## See ${example_common_tcp_options} for more information
|
|
|
tcp.backlog: 1024
|
|
|
@@ -1537,23 +1655,15 @@ zone.default {
|
|
|
listeners.mqtt_wss:
|
|
|
#${example_common_tcp_options} ${example_common_ssl_options} ${example_common_websocket_options} # common options can be written in a separate config entry and reference it from here.
|
|
|
{
|
|
|
- ## The name of the listener.
|
|
|
- ##
|
|
|
- ## @doc zone.<name>.listeners.<name>.name
|
|
|
- ## ValueType: String
|
|
|
- ## Required: true
|
|
|
- name: mqtt_over_wss
|
|
|
|
|
|
## The type of the listener.
|
|
|
##
|
|
|
## @doc zone.<name>.listeners.<name>.type
|
|
|
- ## ValueType: tcp | ssl | ws | wss
|
|
|
+ ## ValueType: tcp | ws
|
|
|
## - tcp: MQTT over TCP
|
|
|
- ## - ssl: MQTT over TLS
|
|
|
## - ws: MQTT over Websocket
|
|
|
- ## - wss: MQTT over WebSocket Secure
|
|
|
## Required: true
|
|
|
- type: wss
|
|
|
+ type: ws
|
|
|
|
|
|
## The IP address and port that the listener will bind.
|
|
|
##
|
|
|
@@ -1566,9 +1676,9 @@ zone.default {
|
|
|
## The size of the acceptor pool for this listener.
|
|
|
##
|
|
|
## @doc zone.<name>.listeners.<name>.acceptors
|
|
|
- ## ValueType: Number | num_cpu_cores
|
|
|
- ## Default: num_cpu_cores
|
|
|
- acceptors: num_cpu_cores
|
|
|
+ ## ValueType: Number
|
|
|
+ ## Default: 16
|
|
|
+ acceptors: 16
|
|
|
|
|
|
## Maximum number of concurrent connections.
|
|
|
##
|
|
|
@@ -1611,8 +1721,64 @@ zone.default {
|
|
|
## Default: 3s
|
|
|
proxy_protocol_timeout: 3s
|
|
|
|
|
|
+ rate_limit {
|
|
|
+ ## Maximum connections per second.
|
|
|
+ ##
|
|
|
+ ## @doc zone.<name>.max_conn_rate
|
|
|
+ ## ValueType: Number | infinity
|
|
|
+ ## Default: 1000
|
|
|
+ ## Examples:
|
|
|
+ ## max_conn_rate: 1000
|
|
|
+ max_conn_rate: 1000
|
|
|
+
|
|
|
+ ## Message limit for the a external MQTT connection.
|
|
|
+ ##
|
|
|
+ ## @doc zone.<name>.rate_limit.conn_messages_in
|
|
|
+ ## ValueType: String | infinity
|
|
|
+ ## Default: infinity
|
|
|
+ ## Examples: 100 messages per 10 seconds.
|
|
|
+ ## conn_messages_in: "100,10s"
|
|
|
+ conn_messages_in: "100,10s"
|
|
|
+
|
|
|
+ ## Limit the rate of receiving packets for a MQTT connection.
|
|
|
+ ## The rate is counted by bytes of packets per second.
|
|
|
+ ##
|
|
|
+ ## The connection won't accept more messages if the messages come
|
|
|
+ ## faster than the limit.
|
|
|
+ ##
|
|
|
+ ## @doc zone.<name>.rate_limit.conn_bytes_in
|
|
|
+ ## ValueType: String | infinity
|
|
|
+ ## Default: infinity
|
|
|
+ ## Examples: 100KB incoming per 10 seconds.
|
|
|
+ ## conn_bytes_in: "100KB,10s"
|
|
|
+ ##
|
|
|
+ conn_bytes_in: "100KB,10s"
|
|
|
+
|
|
|
+ ## Messages quota for the each of external MQTT connection.
|
|
|
+ ## This value consumed by the number of recipient on a message.
|
|
|
+ ##
|
|
|
+ ## @doc zone.<name>.rate_limit.quota.conn_messages_routing
|
|
|
+ ## ValueType: String | infinity
|
|
|
+ ## Default: infinity
|
|
|
+ ## Examples: 100 messaegs per 1s:
|
|
|
+ ## quota.conn_messages_routing: "100,1s"
|
|
|
+ quota.conn_messages_routing: "100,1s"
|
|
|
+
|
|
|
+ ## Messages quota for the all of external MQTT connections.
|
|
|
+ ## This value consumed by the number of recipient on a message.
|
|
|
+ ##
|
|
|
+ ## @doc zone.<name>.rate_limit.quota.overall_messages_routing
|
|
|
+ ## ValueType: String | infinity
|
|
|
+ ## Default: infinity
|
|
|
+ ## Examples: 200000 messages per 1s:
|
|
|
+ ## quota.overall_messages_routing: "200000,1s"
|
|
|
+ ##
|
|
|
+ quota.overall_messages_routing: "200000,1s"
|
|
|
+ }
|
|
|
+
|
|
|
## SSL options
|
|
|
## See ${example_common_ssl_options} for more information
|
|
|
+ ssl.enable: true
|
|
|
ssl.keyfile: "{{ platform_etc_dir }}/certs/key.pem"
|
|
|
ssl.certfile: "{{ platform_etc_dir }}/certs/cert.pem"
|
|
|
ssl.cacertfile: "{{ platform_etc_dir }}/certs/cacert.pem"
|