From 4698856215c177274529a92cdb3d67190a588605 Mon Sep 17 00:00:00 2001 From: Feng Date: Thu, 29 Oct 2015 21:46:06 +0800 Subject: [PATCH] connopts, ratelimit --- rel/files/emqttd.config.development | 19 +++++++++++++++++-- rel/files/emqttd.config.production | 3 ++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/rel/files/emqttd.config.development b/rel/files/emqttd.config.development index 6ec4754c6..16c475523 100644 --- a/rel/files/emqttd.config.development +++ b/rel/files/emqttd.config.development @@ -176,36 +176,50 @@ %% File to store loaded plugin names. {loaded_file, "./data/loaded_plugins"} ]}, + %% Listeners {listeners, [ {mqtt, 1883, [ %% Size of acceptor pool {acceptors, 16}, + %% Maximum number of concurrent clients {max_clients, 512}, + %% Socket Access Control {access, [{allow, all}]}, - %% Rate Limit. Format is 'burst, rate', Unit is KB/Sec - %% {rate_limit, "100,10"}, %% 100K burst, 10K rate + + %% Connection Options + {connopts, [ + %% Rate Limit. Format is 'burst, rate', Unit is KB/Sec + %% {rate_limit, "100,10"} %% 100K burst, 10K rate + ]}, + %% Socket Options {sockopts, [ %Set buffer if hight thoughtput %{recbuf, 4096}, %{sndbuf, 4096}, %{buffer, 4096}, + %{nodelay, true}, {backlog, 512} ]} ]}, + {mqtts, 8883, [ %% Size of acceptor pool {acceptors, 4}, + %% Maximum number of concurrent clients {max_clients, 512}, + %% Socket Access Control {access, [{allow, all}]}, + %% SSL certificate and key files {ssl, [{certfile, "etc/ssl/ssl.crt"}, {keyfile, "etc/ssl/ssl.key"}]}, + %% Socket Options {sockopts, [ {backlog, 1024} @@ -229,6 +243,7 @@ %% {backlog, 1024} %% ]} %%]}, + %% HTTP and WebSocket Listener {http, 8083, [ %% Size of acceptor pool diff --git a/rel/files/emqttd.config.production b/rel/files/emqttd.config.production index e3685518f..a657d7bf3 100644 --- a/rel/files/emqttd.config.production +++ b/rel/files/emqttd.config.production @@ -185,7 +185,8 @@ %{recbuf, 4096}, %{sndbuf, 4096}, %{buffer, 4096}, - {backlog, 512} + %{nodelay, true}, + {backlog, 1024} ]} ]}, {mqtts, 8883, [