Merge pull request #9967 from qzhuyan/perf/william/add-tls-common-conf-hibernate-after
perf: add tls common conf hibernate after
This commit is contained in:
commit
02f15be20f
|
@ -1495,6 +1495,17 @@ In case PSK cipher suites are intended, make sure to configure
|
|||
}
|
||||
}
|
||||
|
||||
common_ssl_opts_schema_hibernate_after {
|
||||
desc {
|
||||
en: """ Hibernate the SSL process after idling for amount of time reducing its memory footprint. """
|
||||
zh: """ 在闲置一定时间后休眠 SSL 进程,减少其内存占用。"""
|
||||
}
|
||||
label: {
|
||||
en: "hibernate after"
|
||||
zh: "闲置多久后休眠"
|
||||
}
|
||||
}
|
||||
|
||||
ciphers_schema_common {
|
||||
desc {
|
||||
en: """This config holds TLS cipher suite names separated by comma,
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
{id, "emqx"},
|
||||
{description, "EMQX Core"},
|
||||
% strict semver, bump manually!
|
||||
{vsn, "5.0.17"},
|
||||
{vsn, "5.0.18"},
|
||||
{modules, []},
|
||||
{registered, []},
|
||||
{applications, [
|
||||
|
|
|
@ -1929,6 +1929,15 @@ common_ssl_opts_schema(Defaults) ->
|
|||
default => Df("secure_renegotiate", true),
|
||||
desc => ?DESC(common_ssl_opts_schema_secure_renegotiate)
|
||||
}
|
||||
)},
|
||||
|
||||
{"hibernate_after",
|
||||
sc(
|
||||
duration(),
|
||||
#{
|
||||
default => Df("hibernate_after", "5s"),
|
||||
desc => ?DESC(common_ssl_opts_schema_hibernate_after)
|
||||
}
|
||||
)}
|
||||
].
|
||||
|
||||
|
|
|
@ -138,6 +138,41 @@ t_restart_listeners(_) ->
|
|||
ok = emqx_listeners:restart(),
|
||||
ok = emqx_listeners:stop().
|
||||
|
||||
t_restart_listeners_with_hibernate_after_disabled(_Config) ->
|
||||
OldLConf = emqx_config:get([listeners]),
|
||||
maps:foreach(
|
||||
fun(LType, Listeners) ->
|
||||
maps:foreach(
|
||||
fun(Name, Opts) ->
|
||||
case maps:is_key(ssl_options, Opts) of
|
||||
true ->
|
||||
emqx_config:put(
|
||||
[
|
||||
listeners,
|
||||
LType,
|
||||
Name,
|
||||
ssl_options,
|
||||
hibernate_after
|
||||
],
|
||||
undefined
|
||||
);
|
||||
_ ->
|
||||
skip
|
||||
end
|
||||
end,
|
||||
Listeners
|
||||
)
|
||||
end,
|
||||
OldLConf
|
||||
),
|
||||
ok = emqx_listeners:start(),
|
||||
ok = emqx_listeners:stop(),
|
||||
%% flakyness: eaddrinuse
|
||||
timer:sleep(timer:seconds(2)),
|
||||
ok = emqx_listeners:restart(),
|
||||
ok = emqx_listeners:stop(),
|
||||
emqx_config:put([listeners], OldLConf).
|
||||
|
||||
t_max_conns_tcp(_) ->
|
||||
%% Note: Using a string representation for the bind address like
|
||||
%% "127.0.0.1" does not work
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
New common TLS option 'hibernate_after' to reduce memory footprint per idle connecion, default: 5s.
|
|
@ -0,0 +1 @@
|
|||
新的通用 TLS 选项 'hibernate_after', 以减少空闲连接的内存占用,默认: 5s 。
|
Loading…
Reference in New Issue