diff --git a/s3config.release.yaml.sample b/s3config.release.yaml.sample index 07d2b8482..72b6510af 100644 --- a/s3config.release.yaml.sample +++ b/s3config.release.yaml.sample @@ -114,7 +114,7 @@ S3_MOTR_CONFIG: # Section for S3 Motr S3_UNIT_SIZES_FOR_MEMORY_POOL: [16384] # Memory pool will be created for each of these unit_size with following properties S3_MOTR_READ_POOL_INITIAL_BUFFER_COUNT: 10 # 10 blocks, the initial pool size = multiple of S3_MOTR_UNIT_SIZE S3_MOTR_READ_POOL_EXPANDABLE_COUNT: 50 # 50 blocks, pool's expandable size, multiple of S3_MOTR_UNIT_SIZE - S3_MOTR_READ_POOL_MAX_THRESHOLD: 1048576000 # 1GB, The maximum memory threshold for the pool, multiple of S3_MOTR_UNIT_SIZE + S3_MOTR_READ_POOL_MAX_THRESHOLD: 524288000 # 500MB, The maximum memory threshold for the pool, multiple of S3_MOTR_UNIT_SIZE S3_MOTR_READ_MEMPOOL_ZERO_BUFFER: false # Enable Motr Mempool 'zeroing' after use (like secure erase) - disabled by default S3_MOTR_OPERATION_WAIT_PERIOD: 90 # 90 s, Maximum wait duration for sync motr operations. S3_MOTR_FIRST_READ_SIZE: 4 # Size in MB of the First Read Request to MOTR diff --git a/scripts/provisioning/configcmd.py b/scripts/provisioning/configcmd.py index a24c91991..ba76b655c 100644 --- a/scripts/provisioning/configcmd.py +++ b/scripts/provisioning/configcmd.py @@ -52,6 +52,8 @@ def __init__(self, config: str, services: str = None): super(ConfigCmd, self).__init__(config, services) self.setup_type = self.get_confvalue_with_defaults('CONFIG>CONFSTORE_SETUP_TYPE') Log.info(f'Setup type : {self.setup_type}') + self.setup_size = self.get_confvalue_with_defaults('CONFIG>CONFSTORE_SETUP_SIZE') + Log.info(f'Setup type : {self.setup_size}') self.cluster_id = self.get_confvalue_with_defaults('CONFIG>CONFSTORE_CLUSTER_ID_KEY') Log.info(f'Cluster id : {self.cluster_id}') self.base_config_file_path = self.get_confvalue_with_defaults('CONFIG>CONFSTORE_BASE_CONFIG_PATH') @@ -157,6 +159,11 @@ def process_s3server(self): 'yaml://') Log.info("validate s3 config files completed") + # update memory limits + Log.info("updating memory limits started") + self.update_memory_limits() + Log.info("updating memory limits complete") + Log.info("create symbolic link of FID config files started") self.create_symbolic_link_fid() Log.info("create symbolic link of FID config files started") @@ -558,6 +565,33 @@ def update_s3_server_configs(self): self.update_config_value("S3_CONFIG_FILE", "yaml", "CONFIG>CONFSTORE_S3_MOTR_MAX_START_TIMEOUT", "S3_MOTR_CONFIG>S3_MOTR_INIT_MAX_TIMEOUT") Log.info("Update s3 server config file completed") + def update_memory_limits(self): + """ Update memory buffer sizes.""" + Log.info("Update memory buffer sizes started") + # validate config file exists - /etc/cortx/s3/conf/s3config.yaml + configfile = self.get_confkey("S3_CONFIG_FILE").replace("/opt/seagate/cortx", self.base_config_file_path) + if path.isfile(f'{configfile}') == False: + Log.error(f'{configfile} file is not present') + raise S3PROVError(f'{configfile} file is not present') + + # load config file, read required keysand modify as per size + s3configfileconfstore = S3CortxConfStore(f'yaml://{configfile}', 'update_limits') + libevent_pool_initial_size = int(s3configfileconfstore.get_config("S3_THIRDPARTY_CONFIG>S3_LIBEVENT_POOL_INITIAL_SIZE")) + libevent_pool_max_threshold = int(s3configfileconfstore.get_config("S3_THIRDPARTY_CONFIG>S3_LIBEVENT_POOL_MAX_THRESHOLD")) + if "small" == self.setup_size: + libevent_pool_initial_size = int(libevent_pool_initial_size / 2); + libevent_pool_max_threshold = int(libevent_pool_max_threshold / 2); + elif "medium" == self.setup_size: + libevent_pool_initial_size = int((libevent_pool_initial_size * 3) / 4); + libevent_pool_max_threshold = int((libevent_pool_max_threshold * 3) / 4); + else: + libevent_pool_initial_size = libevent_pool_initial_size + libevent_pool_max_threshold = libevent_pool_max_threshold + s3configfileconfstore.set_config("S3_THIRDPARTY_CONFIG>S3_LIBEVENT_POOL_INITIAL_SIZE", libevent_pool_initial_size, True) + s3configfileconfstore.set_config("S3_THIRDPARTY_CONFIG>S3_LIBEVENT_POOL_MAX_THRESHOLD", libevent_pool_max_threshold, True) + + Log.info("Update memory buffer sizes completed") + def update_s3_bgdelete_bind_port(self, value_to_update, additional_param): if isinstance(value_to_update, str): value_to_update = literal_eval(value_to_update) diff --git a/scripts/provisioning/s3_prov_config.yaml b/scripts/provisioning/s3_prov_config.yaml index b73e8db8c..9359fe6a0 100644 --- a/scripts/provisioning/s3_prov_config.yaml +++ b/scripts/provisioning/s3_prov_config.yaml @@ -34,6 +34,8 @@ PREPARE: CONFIG: # Public keys which came from provisioner which may or may not have default values. CONFSTORE_SETUP_TYPE: "cortx>common>setup_type" #M (Usedby : s3_deployment) + CONFSTORE_SETUP_SIZE: "cortx>common>setup_size" #O (Usedby : s3_deployment) + CONFSTORE_BASE_LOG_PATH: "cortx>common>storage>log" #M (Usedby : all) CONFSTORE_S3_SECURITY_CERTIFICATE: "cortx>common>security>ssl_certificate" #O default - /etc/ssl/stx/stx.pem (Usedby : s3_deployment, haproxy) #CONFSTORE_S3_STORAGE_MISC: "cortx>common>storage>misc" #O default - /var/data/cortx (Usedby : none) @@ -106,6 +108,7 @@ TEST: DEFAULT_POST_INSTALL: DEFAULT_PREPARE: DEFAULT_CONFIG: + CONFSTORE_SETUP_SIZE: "large" CONFSTORE_LDAPADMIN_USER_KEY: "sgiamadmin" CONFSTORE_S3_MOTR_MAX_UNITS_PER_REQUEST : "8" CONFSTORE_S3_MOTR_MAX_START_TIMEOUT : "240"