From d13055be437a82efa167e09f08321b955692514b Mon Sep 17 00:00:00 2001 From: firest Date: Wed, 8 Jun 2022 10:56:55 +0800 Subject: [PATCH] fix(limiter): add default connection limiter for listeners --- apps/emqx/etc/emqx.conf | 5 +++++ apps/emqx/src/emqx_limiter/etc/emqx_limiter.conf | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/apps/emqx/etc/emqx.conf b/apps/emqx/etc/emqx.conf index bd3ae4af0..f3dee0bcf 100644 --- a/apps/emqx/etc/emqx.conf +++ b/apps/emqx/etc/emqx.conf @@ -1,11 +1,13 @@ listeners.tcp.default { bind = "0.0.0.0:1883" max_connections = 1024000 + limiter.connection = default } listeners.ssl.default { bind = "0.0.0.0:8883" max_connections = 512000 + limiter.connection = default ssl_options { keyfile = "{{ platform_etc_dir }}/certs/key.pem" certfile = "{{ platform_etc_dir }}/certs/cert.pem" @@ -16,12 +18,14 @@ listeners.ssl.default { listeners.ws.default { bind = "0.0.0.0:8083" max_connections = 1024000 + limiter.connection = default websocket.mqtt_path = "/mqtt" } listeners.wss.default { bind = "0.0.0.0:8084" max_connections = 512000 + limiter.connection = default websocket.mqtt_path = "/mqtt" ssl_options { keyfile = "{{ platform_etc_dir }}/certs/key.pem" @@ -34,6 +38,7 @@ listeners.wss.default { # enabled = false # bind = "0.0.0.0:14567" # max_connections = 1024000 +# limiter.connection = default # keyfile = "{{ platform_etc_dir }}/certs/key.pem" # certfile = "{{ platform_etc_dir }}/certs/cert.pem" #} diff --git a/apps/emqx/src/emqx_limiter/etc/emqx_limiter.conf b/apps/emqx/src/emqx_limiter/etc/emqx_limiter.conf index e69de29bb..36c48dde3 100644 --- a/apps/emqx/src/emqx_limiter/etc/emqx_limiter.conf +++ b/apps/emqx/src/emqx_limiter/etc/emqx_limiter.conf @@ -0,0 +1,11 @@ +limiter { + connection { + rate = "1000/s" + bucket { + default { + rate = "1000/s" + capacity = 1000 + } + } + } +}