From 804885cfa51fa01c3d249dcad6a3c804ebf3953f Mon Sep 17 00:00:00 2001 From: Eduardo Alberti Date: Mon, 17 Mar 2025 14:00:07 -0300 Subject: [PATCH] PostgreSQL connection tuning for FM This change updates the default values for the database connection pool parameters in FM application. The reduction of maximum pool size and maximum overflow value can consequently produce a memory usage reduction. These values changes produced a reduction between 5 and 8.5% of applica- tion's original memory allocation. To enable easy management, this change also allows the parameter's control through service-parameters command. This change affects only AIO systems. For distributed cloud, this change only affects subclouds. TEST PLAN: PASS: (AIO-SX, DX, DX+ and Standard) Bootstrap system. PASS: (AIO-SX, DX, DX+ and Standard) Run application in idle state, check memory usage and error-free operation. PASS: (AIO-SX, DX, DX+ and Standard) Run application with workload, check memory usage and error-free operation. PASS: Successfully executed administrative operations (lock, unlock, and Swact - only for duplex and Standard systems). Story: 2011374 Task: 51898 Change-Id: Ia657a0770cfa3e7cbfd9b3ea28c3dc70779f4e22 Signed-off-by: Eduardo Alberti --- .../src/modules/platform/manifests/fm.pp | 52 ++++++++++++++++--- 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/puppet-manifests/src/modules/platform/manifests/fm.pp b/puppet-manifests/src/modules/platform/manifests/fm.pp index 39807657b..25cfbfce1 100644 --- a/puppet-manifests/src/modules/platform/manifests/fm.pp +++ b/puppet-manifests/src/modules/platform/manifests/fm.pp @@ -8,18 +8,58 @@ class platform::fm::params ( $sysinv_catalog_info = 'platform:sysinv:internalURL', $snmp_enabled = 0, $snmp_trap_server_port = 162, -) { } +) { + # Set default values for database connection for AIO systems (except for + # systemcontroller on DC) + if ($::platform::params::system_type == 'All-in-one' and + $::platform::params::distributed_cloud_role != 'systemcontroller') { + $db_idle_timeout = 60 + $db_pool_size = 1 + $db_over_size = 5 + } else { + $db_idle_timeout = undef + $db_pool_size = undef + $db_over_size = undef + } +} +class platform::fm::custom::params ( + $db_idle_timeout = undef, + $db_pool_size = undef, + $db_over_size = undef, +) {} class platform::fm::config inherits ::platform::fm::params { + include ::platform::fm::custom::params + class { '::fm': - region_name => $region_name, - system_name => $system_name, - sysinv_catalog_info => $sysinv_catalog_info, - snmp_enabled => $snmp_enabled, - snmp_trap_server_port => $snmp_trap_server_port, + region_name => $region_name, + system_name => $system_name, + sysinv_catalog_info => $sysinv_catalog_info, + snmp_enabled => $snmp_enabled, + snmp_trap_server_port => $snmp_trap_server_port, + + # Decides between -in order- (1) custom: defined by system parameters, + # (2) AIO values defined on params class, or (3) the default values defined + # on personality yaml + database_idle_timeout => pick_default( + $::platform::fm::custom::params::db_idle_timeout, + $db_idle_timeout, + undef), + database_max_pool_size => pick_default( + $::platform::fm::custom::params::db_pool_size, + $db_pool_size, + undef), + database_min_pool_size => pick_default( + $::platform::fm::custom::params::db_pool_size, + $db_pool_size, + undef), + database_max_overflow => pick_default( + $::platform::fm::custom::params::db_over_size, + $db_over_size, + undef), } }