Merge pull request #9418 from zhongwencool/global-gc-interval
feat: support node.global_gc_interval=disabled
This commit is contained in:
commit
7c048081b1
|
@ -471,8 +471,8 @@ significant: later configuration files override the previous ones.
|
||||||
|
|
||||||
node_global_gc_interval {
|
node_global_gc_interval {
|
||||||
desc {
|
desc {
|
||||||
en: """Periodic garbage collection interval."""
|
en: """Periodic garbage collection interval. Set to <code>disabled</code> to have it disabled."""
|
||||||
zh: """系统调优参数,设置节点运行多久强制进行一次全局垃圾回收。"""
|
zh: """系统调优参数,设置节点运行多久强制进行一次全局垃圾回收。禁用设置为 <code>disabled</code>。"""
|
||||||
}
|
}
|
||||||
label {
|
label {
|
||||||
en: "Global GC Interval"
|
en: "Global GC Interval"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{application, emqx_conf, [
|
{application, emqx_conf, [
|
||||||
{description, "EMQX configuration management"},
|
{description, "EMQX configuration management"},
|
||||||
{vsn, "0.1.6"},
|
{vsn, "0.1.7"},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{mod, {emqx_conf_app, []}},
|
{mod, {emqx_conf_app, []}},
|
||||||
{applications, [kernel, stdlib]},
|
{applications, [kernel, stdlib]},
|
||||||
|
|
|
@ -468,7 +468,7 @@ fields("node") ->
|
||||||
)},
|
)},
|
||||||
{"global_gc_interval",
|
{"global_gc_interval",
|
||||||
sc(
|
sc(
|
||||||
emqx_schema:duration(),
|
hoconsc:union([disabled, emqx_schema:duration()]),
|
||||||
#{
|
#{
|
||||||
mapping => "emqx_machine.global_gc_interval",
|
mapping => "emqx_machine.global_gc_interval",
|
||||||
default => "15m",
|
default => "15m",
|
||||||
|
|
|
@ -29,4 +29,8 @@ t_run_gc(_) ->
|
||||||
ok = timer:sleep(1500),
|
ok = timer:sleep(1500),
|
||||||
{ok, MilliSecs} = emqx_global_gc:run(),
|
{ok, MilliSecs} = emqx_global_gc:run(),
|
||||||
ct:print("Global GC: ~w(ms)~n", [MilliSecs]),
|
ct:print("Global GC: ~w(ms)~n", [MilliSecs]),
|
||||||
emqx_global_gc:stop().
|
emqx_global_gc:stop(),
|
||||||
|
ok = emqx_config:put([node, global_gc_interval], disabled),
|
||||||
|
{ok, Pid} = emqx_global_gc:start_link(),
|
||||||
|
?assertMatch(#{timer := undefined}, sys:get_state(Pid)),
|
||||||
|
ok.
|
||||||
|
|
|
@ -82,10 +82,10 @@ code_change(_OldVsn, State, _Extra) ->
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
|
|
||||||
ensure_timer(State) ->
|
ensure_timer(State) ->
|
||||||
case application:get_env(emqx_machine, global_gc_interval) of
|
case application:get_env(emqx_machine, global_gc_interval, disabled) of
|
||||||
undefined ->
|
disabled ->
|
||||||
State;
|
State;
|
||||||
{ok, Interval} ->
|
Interval when is_integer(Interval) ->
|
||||||
TRef = emqx_misc:start_timer(Interval, run),
|
TRef = emqx_misc:start_timer(Interval, run),
|
||||||
State#{timer := TRef}
|
State#{timer := TRef}
|
||||||
end.
|
end.
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
{id, "emqx_machine"},
|
{id, "emqx_machine"},
|
||||||
{description, "The EMQX Machine"},
|
{description, "The EMQX Machine"},
|
||||||
% strict semver, bump manually!
|
% strict semver, bump manually!
|
||||||
{vsn, "0.1.0"},
|
{vsn, "0.1.1"},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{applications, [kernel, stdlib]},
|
{applications, [kernel, stdlib]},
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
## Enhancements
|
## Enhancements
|
||||||
|
|
||||||
|
- Disable global garbage collection by `node.global_gc_interval = disabled` [#9418](https://github.com/emqx/emqx/pull/9418)。
|
||||||
|
|
||||||
- Improve the CLI to avoid waste atom table when typing erros [#9416](https://github.com/emqx/emqx/pull/9416).
|
- Improve the CLI to avoid waste atom table when typing erros [#9416](https://github.com/emqx/emqx/pull/9416).
|
||||||
|
|
||||||
- Start building MacOS packages for Apple Silicon hadrdware [#9423](https://github.com/emqx/emqx/pull/9423).
|
- Start building MacOS packages for Apple Silicon hadrdware [#9423](https://github.com/emqx/emqx/pull/9423).
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
## 增强
|
## 增强
|
||||||
|
|
||||||
|
- 通过 `node.global_gc_interval = disabled` 来禁用全局垃圾回收 [#9418](https://github.com/emqx/emqx/pull/9418)。
|
||||||
|
|
||||||
## 修复
|
## 修复
|
||||||
|
|
||||||
- 优化命令行实现, 避免输入错误指令时, 产生不必要的原子表消耗 [#9416](https://github.com/emqx/emqx/pull/9416)。
|
- 优化命令行实现, 避免输入错误指令时, 产生不必要的原子表消耗 [#9416](https://github.com/emqx/emqx/pull/9416)。
|
||||||
|
|
Loading…
Reference in New Issue