feat: hide node.process_limit
This commit is contained in:
parent
38bd8a8185
commit
b4ae4260c0
|
@ -65,6 +65,8 @@
|
||||||
emqx_slow_subs_schema,
|
emqx_slow_subs_schema,
|
||||||
emqx_mgmt_api_key_schema
|
emqx_mgmt_api_key_schema
|
||||||
]).
|
]).
|
||||||
|
%% 1 million default ports counter
|
||||||
|
-define(DEFAULT_MAX_PORTS, 1024 * 1024).
|
||||||
|
|
||||||
%% root config should not have a namespace
|
%% root config should not have a namespace
|
||||||
namespace() -> undefined.
|
namespace() -> undefined.
|
||||||
|
@ -83,7 +85,10 @@ roots() ->
|
||||||
{"node",
|
{"node",
|
||||||
sc(
|
sc(
|
||||||
?R_REF("node"),
|
?R_REF("node"),
|
||||||
#{translate_to => ["emqx"]}
|
#{
|
||||||
|
translate_to => ["emqx"],
|
||||||
|
converter => fun node_converter/2
|
||||||
|
}
|
||||||
)},
|
)},
|
||||||
{"cluster",
|
{"cluster",
|
||||||
sc(
|
sc(
|
||||||
|
@ -441,8 +446,8 @@ fields("node") ->
|
||||||
#{
|
#{
|
||||||
mapping => "vm_args.+P",
|
mapping => "vm_args.+P",
|
||||||
desc => ?DESC(process_limit),
|
desc => ?DESC(process_limit),
|
||||||
default => 2097152,
|
default => ?DEFAULT_MAX_PORTS * 2,
|
||||||
importance => ?IMPORTANCE_MEDIUM,
|
importance => ?IMPORTANCE_HIDDEN,
|
||||||
'readOnly' => true
|
'readOnly' => true
|
||||||
}
|
}
|
||||||
)},
|
)},
|
||||||
|
@ -452,7 +457,7 @@ fields("node") ->
|
||||||
#{
|
#{
|
||||||
mapping => "vm_args.+Q",
|
mapping => "vm_args.+Q",
|
||||||
desc => ?DESC(max_ports),
|
desc => ?DESC(max_ports),
|
||||||
default => 1048576,
|
default => ?DEFAULT_MAX_PORTS,
|
||||||
importance => ?IMPORTANCE_HIGH,
|
importance => ?IMPORTANCE_HIGH,
|
||||||
'readOnly' => true
|
'readOnly' => true
|
||||||
}
|
}
|
||||||
|
@ -1388,3 +1393,10 @@ ensure_unicode_path(Path, _) when is_list(Path) ->
|
||||||
Path;
|
Path;
|
||||||
ensure_unicode_path(Path, _) ->
|
ensure_unicode_path(Path, _) ->
|
||||||
throw({"not_string", Path}).
|
throw({"not_string", Path}).
|
||||||
|
|
||||||
|
node_converter(#{<<"process_limit">> := _} = Conf, _Opts) ->
|
||||||
|
Conf;
|
||||||
|
node_converter(#{<<"max_ports">> := MaxPorts} = Conf, _Opts) ->
|
||||||
|
Conf#{<<"process_limit">> => MaxPorts * 2};
|
||||||
|
node_converter(Conf, _Opts) ->
|
||||||
|
Conf.
|
||||||
|
|
Loading…
Reference in New Issue