Merge branch 'Ayanda-D-configurable-mgmt-delegate-pool'

This commit is contained in:
Michael Klishin 2025-03-06 15:54:53 -05:00
commit 569edb0841
No known key found for this signature in database
GPG Key ID: 44BF2725475205B2
4 changed files with 18 additions and 3 deletions

View File

@ -35,7 +35,8 @@ APP_ENV = """[
{cors_allow_origins, []}, {cors_allow_origins, []},
{cors_max_age, 1800}, {cors_max_age, 1800},
{content_security_policy, "script-src 'self' 'unsafe-eval' 'unsafe-inline'; object-src 'self'"}, {content_security_policy, "script-src 'self' 'unsafe-eval' 'unsafe-inline'; object-src 'self'"},
{max_http_body_size, 10000000} {max_http_body_size, 10000000},
{delegate_count, 5}
]""" ]"""
genrule( genrule(

View File

@ -13,7 +13,8 @@ define PROJECT_ENV
{cors_allow_origins, []}, {cors_allow_origins, []},
{cors_max_age, 1800}, {cors_max_age, 1800},
{content_security_policy, "script-src 'self' 'unsafe-eval' 'unsafe-inline'; object-src 'self'"}, {content_security_policy, "script-src 'self' 'unsafe-eval' 'unsafe-inline'; object-src 'self'"},
{max_http_body_size, 10000000} {max_http_body_size, 10000000},
{delegate_count, 5}
] ]
endef endef

View File

@ -37,6 +37,15 @@ fun(Conf) ->
end}. end}.
%% Number of delegate processes to use for metrics acquisition intra-cluster
%% communication. On a machine which has a very large number of cores and is
%% also part of a cluster, you may wish to increase this value.
%%
{mapping, "management.delegate_count", "rabbitmq_management.delegate_count", [
{datatype, integer}, {validators, ["non_negative_integer"]}
]}.
%% HTTP (TCP) listener options ======================================================== %% HTTP (TCP) listener options ========================================================
%% HTTP listener consistent with Web STOMP and Web MQTT. %% HTTP listener consistent with Web STOMP and Web MQTT.

View File

@ -37,9 +37,10 @@ maybe_enable_metrics_collector() ->
case rabbit_mgmt_agent_config:is_metrics_collector_enabled() of case rabbit_mgmt_agent_config:is_metrics_collector_enabled() of
true -> true ->
ok = pg:join(?MANAGEMENT_PG_SCOPE, ?MANAGEMENT_PG_GROUP, self()), ok = pg:join(?MANAGEMENT_PG_SCOPE, ?MANAGEMENT_PG_GROUP, self()),
MDC = get_management_delegate_count(),
ST = {rabbit_mgmt_storage, {rabbit_mgmt_storage, start_link, []}, ST = {rabbit_mgmt_storage, {rabbit_mgmt_storage, start_link, []},
permanent, ?WORKER_WAIT, worker, [rabbit_mgmt_storage]}, permanent, ?WORKER_WAIT, worker, [rabbit_mgmt_storage]},
MD = {delegate_management_sup, {delegate_sup, start_link, [5, ?DELEGATE_PREFIX]}, MD = {delegate_management_sup, {delegate_sup, start_link, [MDC, ?DELEGATE_PREFIX]},
permanent, ?SUPERVISOR_WAIT, supervisor, [delegate_sup]}, permanent, ?SUPERVISOR_WAIT, supervisor, [delegate_sup]},
MC = [{rabbit_mgmt_metrics_collector:name(Table), MC = [{rabbit_mgmt_metrics_collector:name(Table),
{rabbit_mgmt_metrics_collector, start_link, [Table]}, {rabbit_mgmt_metrics_collector, start_link, [Table]},
@ -55,3 +56,6 @@ maybe_enable_metrics_collector() ->
false -> false ->
[] []
end. end.
get_management_delegate_count() ->
application:get_env(rabbitmq_management, delegate_count, 5).