Merge branch 'more-gc-enforcement-policies' into emqx30
This commit is contained in:
commit
b4b31dbfe4
|
@ -544,6 +544,12 @@ zone.external.enable_acl = on
|
||||||
## Value: on | off
|
## Value: on | off
|
||||||
zone.external.enable_stats = on
|
zone.external.enable_stats = on
|
||||||
|
|
||||||
|
## Force MQTT connection/session process GC after this number of
|
||||||
|
## messages | bytes passed through.
|
||||||
|
##
|
||||||
|
## Numbers delimited by `|'. Zero or negative is to disable.
|
||||||
|
zone.external.force_gc_policy = 1000|1MB
|
||||||
|
|
||||||
## Maximum MQTT packet size allowed.
|
## Maximum MQTT packet size allowed.
|
||||||
##
|
##
|
||||||
## Value: Bytes
|
## Value: Bytes
|
||||||
|
|
|
@ -852,8 +852,13 @@ end}.
|
||||||
{mqtt_shared_subscription, Val};
|
{mqtt_shared_subscription, Val};
|
||||||
("force_gc_policy", Val) ->
|
("force_gc_policy", Val) ->
|
||||||
[Count, Bytes] = string:tokens(Val, "| "),
|
[Count, Bytes] = string:tokens(Val, "| "),
|
||||||
{force_gc_policy, #{count => list_to_integer(Count),
|
GcPolicy = case cuttlefish_bytesize:parse(Bytes) of
|
||||||
bytes => list_to_integer(Bytes)}};
|
{error, Reason} ->
|
||||||
|
error(Reason);
|
||||||
|
Bytes1 ->
|
||||||
|
#{bytes => Bytes1, count => list_to_integer(Count)}
|
||||||
|
end,
|
||||||
|
{force_gc_policy, GcPolicy};
|
||||||
("force_shutdown_policy", Val) ->
|
("force_shutdown_policy", Val) ->
|
||||||
[Len, Siz] = string:tokens(Val, "| "),
|
[Len, Siz] = string:tokens(Val, "| "),
|
||||||
ShutdownPolicy = case cuttlefish_bytesize:parse(Siz) of
|
ShutdownPolicy = case cuttlefish_bytesize:parse(Siz) of
|
||||||
|
|
|
@ -21,8 +21,6 @@
|
||||||
|
|
||||||
-module(emqx_gc).
|
-module(emqx_gc).
|
||||||
|
|
||||||
-author("Feng Lee <feng@emqtt.io>").
|
|
||||||
|
|
||||||
-export([init/1, inc/2, reset/0]).
|
-export([init/1, inc/2, reset/0]).
|
||||||
|
|
||||||
-type st() :: #{ cnt => {integer(), integer()}
|
-type st() :: #{ cnt => {integer(), integer()}
|
||||||
|
|
Loading…
Reference in New Issue