connopts, ratelimit

This commit is contained in:
Feng 2015-10-29 21:46:06 +08:00
parent af1cc669c8
commit 4698856215
2 changed files with 19 additions and 3 deletions

View File

@ -176,36 +176,50 @@
%% File to store loaded plugin names. %% File to store loaded plugin names.
{loaded_file, "./data/loaded_plugins"} {loaded_file, "./data/loaded_plugins"}
]}, ]},
%% Listeners %% Listeners
{listeners, [ {listeners, [
{mqtt, 1883, [ {mqtt, 1883, [
%% Size of acceptor pool %% Size of acceptor pool
{acceptors, 16}, {acceptors, 16},
%% Maximum number of concurrent clients %% Maximum number of concurrent clients
{max_clients, 512}, {max_clients, 512},
%% Socket Access Control %% Socket Access Control
{access, [{allow, all}]}, {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 %% Socket Options
{sockopts, [ {sockopts, [
%Set buffer if hight thoughtput %Set buffer if hight thoughtput
%{recbuf, 4096}, %{recbuf, 4096},
%{sndbuf, 4096}, %{sndbuf, 4096},
%{buffer, 4096}, %{buffer, 4096},
%{nodelay, true},
{backlog, 512} {backlog, 512}
]} ]}
]}, ]},
{mqtts, 8883, [ {mqtts, 8883, [
%% Size of acceptor pool %% Size of acceptor pool
{acceptors, 4}, {acceptors, 4},
%% Maximum number of concurrent clients %% Maximum number of concurrent clients
{max_clients, 512}, {max_clients, 512},
%% Socket Access Control %% Socket Access Control
{access, [{allow, all}]}, {access, [{allow, all}]},
%% SSL certificate and key files %% SSL certificate and key files
{ssl, [{certfile, "etc/ssl/ssl.crt"}, {ssl, [{certfile, "etc/ssl/ssl.crt"},
{keyfile, "etc/ssl/ssl.key"}]}, {keyfile, "etc/ssl/ssl.key"}]},
%% Socket Options %% Socket Options
{sockopts, [ {sockopts, [
{backlog, 1024} {backlog, 1024}
@ -229,6 +243,7 @@
%% {backlog, 1024} %% {backlog, 1024}
%% ]} %% ]}
%%]}, %%]},
%% HTTP and WebSocket Listener %% HTTP and WebSocket Listener
{http, 8083, [ {http, 8083, [
%% Size of acceptor pool %% Size of acceptor pool

View File

@ -185,7 +185,8 @@
%{recbuf, 4096}, %{recbuf, 4096},
%{sndbuf, 4096}, %{sndbuf, 4096},
%{buffer, 4096}, %{buffer, 4096},
{backlog, 512} %{nodelay, true},
{backlog, 1024}
]} ]}
]}, ]},
{mqtts, 8883, [ {mqtts, 8883, [