Skip to content

Commit 561b410

Browse files
Merge branch 'Ayanda-D-configurable-mgmt-delegate-pool'
(cherry picked from commit 569edb0)
1 parent 454a39c commit 561b410

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

deps/rabbitmq_management/BUILD.bazel

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ APP_ENV = """[
3535
{cors_allow_origins, []},
3636
{cors_max_age, 1800},
3737
{content_security_policy, "script-src 'self' 'unsafe-eval' 'unsafe-inline'; object-src 'self'"},
38-
{max_http_body_size, 10000000}
38+
{max_http_body_size, 10000000},
39+
{delegate_count, 5}
3940
]"""
4041

4142
genrule(

deps/rabbitmq_management/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ define PROJECT_ENV
1313
{cors_allow_origins, []},
1414
{cors_max_age, 1800},
1515
{content_security_policy, "script-src 'self' 'unsafe-eval' 'unsafe-inline'; object-src 'self'"},
16-
{max_http_body_size, 10000000}
16+
{max_http_body_size, 10000000},
17+
{delegate_count, 5}
1718
]
1819
endef
1920

deps/rabbitmq_management/priv/schema/rabbitmq_management.schema

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ fun(Conf) ->
3737
end}.
3838

3939

40+
%% Number of delegate processes to use for metrics acquisition intra-cluster
41+
%% communication. On a machine which has a very large number of cores and is
42+
%% also part of a cluster, you may wish to increase this value.
43+
%%
44+
45+
{mapping, "management.delegate_count", "rabbitmq_management.delegate_count", [
46+
{datatype, integer}, {validators, ["non_negative_integer"]}
47+
]}.
48+
4049
%% HTTP (TCP) listener options ========================================================
4150

4251
%% HTTP listener consistent with Web STOMP and Web MQTT.

deps/rabbitmq_management_agent/src/rabbit_mgmt_agent_sup.erl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ maybe_enable_metrics_collector() ->
3737
case rabbit_mgmt_agent_config:is_metrics_collector_enabled() of
3838
true ->
3939
ok = pg:join(?MANAGEMENT_PG_SCOPE, ?MANAGEMENT_PG_GROUP, self()),
40+
MDC = get_management_delegate_count(),
4041
ST = {rabbit_mgmt_storage, {rabbit_mgmt_storage, start_link, []},
4142
permanent, ?WORKER_WAIT, worker, [rabbit_mgmt_storage]},
42-
MD = {delegate_management_sup, {delegate_sup, start_link, [5, ?DELEGATE_PREFIX]},
43+
MD = {delegate_management_sup, {delegate_sup, start_link, [MDC, ?DELEGATE_PREFIX]},
4344
permanent, ?SUPERVISOR_WAIT, supervisor, [delegate_sup]},
4445
MC = [{rabbit_mgmt_metrics_collector:name(Table),
4546
{rabbit_mgmt_metrics_collector, start_link, [Table]},
@@ -55,3 +56,6 @@ maybe_enable_metrics_collector() ->
5556
false ->
5657
[]
5758
end.
59+
60+
get_management_delegate_count() ->
61+
application:get_env(rabbitmq_management, delegate_count, 5).

0 commit comments

Comments
 (0)