Skip to content

Commit c521681

Browse files
authored
Merge pull request ceph#53527 from rhcs-dashboard/add-rgw-perf-counter-cache
cephadm/rgw: make rgw perf counters cache and it's size configurable Reviewed-by: Adam King <adking@redhat.com> Reviewed-by: Ali Maredia <amaredia@redhat.com>
2 parents 0ce0344 + 38e74cf commit c521681

File tree

2 files changed

+47
-2
lines changed

2 files changed

+47
-2
lines changed

src/pybind/mgr/cephadm/services/cephadmservice.py

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,14 +1022,46 @@ def prepare_create(self, daemon_spec: CephadmDaemonDeploySpec) -> CephadmDaemonD
10221022
args.extend(spec.rgw_frontend_extra_args)
10231023

10241024
frontend = f'{ftype} {" ".join(args)}'
1025+
daemon_name = utils.name_to_config_section(daemon_spec.name())
10251026

10261027
ret, out, err = self.mgr.check_mon_command({
10271028
'prefix': 'config set',
1028-
'who': utils.name_to_config_section(daemon_spec.name()),
1029+
'who': daemon_name,
10291030
'name': 'rgw_frontends',
10301031
'value': frontend
10311032
})
10321033

1034+
if spec.rgw_user_counters_cache:
1035+
ret, out, err = self.mgr.check_mon_command({
1036+
'prefix': 'config set',
1037+
'who': daemon_name,
1038+
'name': 'rgw_user_counters_cache',
1039+
'value': 'true',
1040+
})
1041+
if spec.rgw_bucket_counters_cache:
1042+
ret, out, err = self.mgr.check_mon_command({
1043+
'prefix': 'config set',
1044+
'who': daemon_name,
1045+
'name': 'rgw_bucket_counters_cache',
1046+
'value': 'true',
1047+
})
1048+
1049+
if spec.rgw_user_counters_cache_size:
1050+
ret, out, err = self.mgr.check_mon_command({
1051+
'prefix': 'config set',
1052+
'who': daemon_name,
1053+
'name': 'rgw_user_counters_cache_size',
1054+
'value': str(spec.rgw_user_counters_cache_size),
1055+
})
1056+
1057+
if spec.rgw_bucket_counters_cache_size:
1058+
ret, out, err = self.mgr.check_mon_command({
1059+
'prefix': 'config set',
1060+
'who': daemon_name,
1061+
'name': 'rgw_bucket_counters_cache_size',
1062+
'value': str(spec.rgw_bucket_counters_cache_size),
1063+
})
1064+
10331065
daemon_spec.keyring = keyring
10341066
daemon_spec.final_config, daemon_spec.deps = self.generate_config(daemon_spec)
10351067

src/python-common/ceph/deployment/service_spec.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,11 @@ def __init__(self,
11681168
custom_configs: Optional[List[CustomConfig]] = None,
11691169
rgw_realm_token: Optional[str] = None,
11701170
update_endpoints: Optional[bool] = False,
1171-
zone_endpoints: Optional[str] = None # commad separated endpoints list
1171+
zone_endpoints: Optional[str] = None, # comma separated endpoints list
1172+
rgw_user_counters_cache: Optional[bool] = False,
1173+
rgw_user_counters_cache_size: Optional[int] = None,
1174+
rgw_bucket_counters_cache: Optional[bool] = False,
1175+
rgw_bucket_counters_cache_size: Optional[int] = None
11721176
):
11731177
assert service_type == 'rgw', service_type
11741178

@@ -1209,6 +1213,15 @@ def __init__(self,
12091213
self.update_endpoints = update_endpoints
12101214
self.zone_endpoints = zone_endpoints
12111215

1216+
#: To track op metrics by user config value rgw_user_counters_cache must be set to true
1217+
self.rgw_user_counters_cache = rgw_user_counters_cache
1218+
#: Used to set number of entries in each cache of user counters
1219+
self.rgw_user_counters_cache_size = rgw_user_counters_cache_size
1220+
#: To track op metrics by bucket config value rgw_bucket_counters_cache must be set to true
1221+
self.rgw_bucket_counters_cache = rgw_bucket_counters_cache
1222+
#: Used to set number of entries in each cache of bucket counters
1223+
self.rgw_bucket_counters_cache_size = rgw_bucket_counters_cache_size
1224+
12121225
def get_port_start(self) -> List[int]:
12131226
return [self.get_port()]
12141227

0 commit comments

Comments
 (0)