aboutsummaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service
diff options
context:
space:
mode:
authordanielhanrahan <daniel.hanrahan@est.tech>2024-03-15 12:42:15 +0000
committerdanielhanrahan <daniel.hanrahan@est.tech>2024-03-19 10:08:19 +0000
commite1277ab49cfbd8fd980336b1f2b84bca3166a449 (patch)
treea448d6c891c9def39837d11c7ddaad1998e99ae6 /cps-ncmp-service
parentbf75ff4d43dc9eb459deaf61920de22cf5c6f1ea (diff)
Configure Hazelcast to have 1 backup to reduce memory
Currently Hazelcast is configured to have 3 synchronous backups and 3 asynchronous backups. These are separate, meaning there will be 7 copies in the cluster (1 original + 3 sync + 3 async backups). Even if only 1 instance of CPS/NCMP is running, it will have 7 copies in memory. Given that CPS/NCMP is typically only deployed using 1 or 2 instances, the settings are changed to 1 synchronous backup (same as Hazelcast's default configuration). This change has been tested and shown to reduce heap usage by around 100MB during 20K CM-handle registration. Issue-ID: CPS-2146 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I4a5f6d83bc35e2c13cfb32002e38dc365da34c8e
Diffstat (limited to 'cps-ncmp-service')
-rw-r--r--cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/config/embeddedcache/SynchronizationCacheConfigSpec.groovy12
-rw-r--r--cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/config/embeddedcache/TrustLevelCacheConfigSpec.groovy4
2 files changed, 8 insertions, 8 deletions
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/config/embeddedcache/SynchronizationCacheConfigSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/config/embeddedcache/SynchronizationCacheConfigSpec.groovy
index 3b1709d80..6d09df0d4 100644
--- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/config/embeddedcache/SynchronizationCacheConfigSpec.groovy
+++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/config/embeddedcache/SynchronizationCacheConfigSpec.groovy
@@ -69,14 +69,14 @@ class SynchronizationCacheConfigSpec extends Specification {
def dataSyncSemaphoresConfig = Hazelcast.getHazelcastInstanceByName('dataSyncSemaphores').config
def dataSyncSemaphoresMapConfig = dataSyncSemaphoresConfig.mapConfigs.get('dataSyncSemaphoresConfig')
expect: 'system created instance with correct config of Module Sync Work Queue'
- assert moduleSyncDefaultWorkQueueConfig.backupCount == 3
- assert moduleSyncDefaultWorkQueueConfig.asyncBackupCount == 3
+ assert moduleSyncDefaultWorkQueueConfig.backupCount == 1
+ assert moduleSyncDefaultWorkQueueConfig.asyncBackupCount == 0
and: 'Module Sync Started Cm Handle Map has the correct settings'
- assert moduleSyncStartedOnCmHandlesMapConfig.backupCount == 3
- assert moduleSyncStartedOnCmHandlesMapConfig.asyncBackupCount == 3
+ assert moduleSyncStartedOnCmHandlesMapConfig.backupCount == 1
+ assert moduleSyncStartedOnCmHandlesMapConfig.asyncBackupCount == 0
and: 'Data Sync Semaphore Map has the correct settings'
- assert dataSyncSemaphoresMapConfig.backupCount == 3
- assert dataSyncSemaphoresMapConfig.asyncBackupCount == 3
+ assert dataSyncSemaphoresMapConfig.backupCount == 1
+ assert dataSyncSemaphoresMapConfig.asyncBackupCount == 0
and: 'all instances are part of same cluster'
def testClusterName = 'cps-and-ncmp-test-caches'
assert moduleSyncWorkQueueConfig.clusterName == testClusterName
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/config/embeddedcache/TrustLevelCacheConfigSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/config/embeddedcache/TrustLevelCacheConfigSpec.groovy
index 3eff96d79..c213ab626 100644
--- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/config/embeddedcache/TrustLevelCacheConfigSpec.groovy
+++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/config/embeddedcache/TrustLevelCacheConfigSpec.groovy
@@ -62,8 +62,8 @@ class TrustLevelCacheConfigSpec extends Specification {
when: 'retrieving the map config for trustLevel'
def mapConfig = cacheConfig.mapConfigs.get(hazelcastMapConfigName)
then: 'the map config has the correct backup counts'
- assert mapConfig.backupCount == 3
- assert mapConfig.asyncBackupCount == 3
+ assert mapConfig.backupCount == 1
+ assert mapConfig.asyncBackupCount == 0
where: 'the following caches are used'
scenario | hazelcastInstanceName | hazelcastMapConfigName
'cmhandle map' | 'hazelcastInstanceTrustLevelPerCmHandleMap' | 'trustLevelPerCmHandleCacheConfig'