fix(config): enable force_shutdown_policy by default

This commit is contained in:
terry-xiaoyu 2020-09-30 11:35:56 +08:00
parent 048e510dde
commit 7b98f62f7a
3 changed files with 25 additions and 6 deletions

View File

@ -730,7 +730,11 @@ zone.external.force_gc_policy = 16000|16MB
## of queued MQTT messages of QoS 1 and 2.
##
## Numbers delimited by `|'. Zero or negative is to disable.
zone.external.force_shutdown_policy = 10000|32MB
##
## Default:
## - 10000|64MB on ARCH_64 system
## - 1000|32MB on ARCH_32 sytem
#zone.external.force_shutdown_policy = 10000|64MB
## Maximum MQTT packet size allowed.
##
@ -982,7 +986,11 @@ zone.internal.mqueue_store_qos0 = true
zone.internal.enable_flapping_detect = off
## See zone.$name.force_shutdown_policy
zone.internal.force_shutdown_policy = 128000|64MB
##
## Default:
## - 10000|64MB on ARCH_64 system
## - 1000|32MB on ARCH_32 sytem
#zone.internal.force_shutdown_policy = 10000|64MB
## All the topics will be prefixed with the mountpoint path if this option is enabled.
##

View File

@ -1087,9 +1087,9 @@ end}.
{DefaultLen, DefaultSize} =
case WordSize = erlang:system_info(wordsize) of
8 -> % arch_64
{10000, cuttlefish_bytesize:parse("32MB")};
{10000, cuttlefish_bytesize:parse("64MB")};
4 -> % arch_32
{10000, cuttlefish_bytesize:parse("16MB")}
{1000, cuttlefish_bytesize:parse("32MB")}
end,
{force_shutdown_policy, #{message_queue_len => DefaultLen,
max_heap_size => DefaultSize div WordSize

View File

@ -1,7 +1,18 @@
{DefaultLen, DefaultSize} =
case WordSize = erlang:system_info(wordsize) of
8 -> % arch_64
{10000, cuttlefish_bytesize:parse("64MB")};
4 -> % arch_32
{1000, cuttlefish_bytesize:parse("32MB")}
end,
{"4.2.1",
[
{"4.2.0", [
{load_module, emqx_channel, brutal_purge, soft_purge, []}
{load_module, emqx_channel, brutal_purge, soft_purge, []},
{apply, {application, set_env,
[emqx, force_shutdown_policy,
#{message_queue_len => DefaultLen,
max_heap_size => DefaultSize div WordSize}]}}
]}
],
[
@ -9,4 +20,4 @@
{load_module, emqx_channel, brutal_purge, soft_purge, []}
]}
]
}.
}.