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
e248cd6c66
commit
c3b7d76102
|
@ -131,8 +131,8 @@ fields(topology) ->
|
|||
hoconsc:mk(
|
||||
pos_integer(),
|
||||
#{
|
||||
deprecated => {since, "5.1.1"},
|
||||
importance => ?IMPORTANCE_HIDDEN
|
||||
importance => ?IMPORTANCE_HIDDEN,
|
||||
default => 10
|
||||
}
|
||||
)},
|
||||
{max_overflow, fun max_overflow/1},
|
||||
|
@ -201,23 +201,7 @@ on_start(
|
|||
false ->
|
||||
[{ssl, false}]
|
||||
end,
|
||||
Topology0 = 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},
|
||||
Topology = maps:get(topology, NConfig, #{}),
|
||||
Opts = [
|
||||
{mongo_type, init_type(NConfig)},
|
||||
{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