perf: un-deprecate mongodb topology pool_size and set it to 10 by default
Benchmarks proved that it effects performance: 10 ecpool workers / 10 topology pool workers outperform 100 ecpool / 1 topology worker. Fixes: EMQX-11825
This commit is contained in:
parent
c9ee5addb4
commit
1d9ce709f4
|
@ -131,8 +131,8 @@ fields(topology) ->
|
||||||
hoconsc:mk(
|
hoconsc:mk(
|
||||||
pos_integer(),
|
pos_integer(),
|
||||||
#{
|
#{
|
||||||
deprecated => {since, "5.1.1"},
|
importance => ?IMPORTANCE_HIDDEN,
|
||||||
importance => ?IMPORTANCE_HIDDEN
|
default => 10
|
||||||
}
|
}
|
||||||
)},
|
)},
|
||||||
{max_overflow, fun max_overflow/1},
|
{max_overflow, fun max_overflow/1},
|
||||||
|
@ -201,23 +201,7 @@ on_start(
|
||||||
false ->
|
false ->
|
||||||
[{ssl, false}]
|
[{ssl, false}]
|
||||||
end,
|
end,
|
||||||
Topology0 = maps:get(topology, NConfig, #{}),
|
Topology = maps:get(topology, NConfig, #{}),
|
||||||
%% we fix this at 1 because we already have ecpool
|
|
||||||
case maps:get(pool_size, Topology0, 1) =:= 1 of
|
|
||||||
true ->
|
|
||||||
ok;
|
|
||||||
false ->
|
|
||||||
?SLOG(
|
|
||||||
info,
|
|
||||||
#{
|
|
||||||
msg => "mongodb_overriding_topology_pool_size",
|
|
||||||
connector => InstId,
|
|
||||||
reason => "this option is deprecated; please set `pool_size' for the connector",
|
|
||||||
value => 1
|
|
||||||
}
|
|
||||||
)
|
|
||||||
end,
|
|
||||||
Topology = Topology0#{pool_size => 1},
|
|
||||||
Opts = [
|
Opts = [
|
||||||
{mongo_type, init_type(NConfig)},
|
{mongo_type, init_type(NConfig)},
|
||||||
{hosts, Hosts},
|
{hosts, Hosts},
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
Improve MongoDB connector performance.
|
||||||
|
|
||||||
|
- [mongodb-erlang PR](https://github.com/emqx/mongodb-erlang/pull/41)
|
Loading…
Reference in New Issue