[AAI] Make janusgraph caching configurable 47/136947/1
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Mon, 8 Jan 2024 15:04:02 +0000 (16:04 +0100)
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Mon, 8 Jan 2024 15:04:02 +0000 (16:04 +0100)
- add optional config block to janusgraph-realtime.properties

Issue-ID: AAI-3721
Change-Id: Ifc19c5e3c134289092150d3c95f95ab6a2f20b82
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
kubernetes/aai/components/aai-resources/resources/config/application.properties
kubernetes/aai/components/aai-resources/resources/config/janusgraph-realtime.properties
kubernetes/aai/components/aai-resources/values.yaml
kubernetes/aai/components/aai-traversal/resources/config/application.properties
kubernetes/aai/components/aai-traversal/resources/config/janusgraph-realtime.properties
kubernetes/aai/components/aai-traversal/values.yaml

index 805f3cd..817849f 100644 (file)
@@ -101,10 +101,10 @@ schema.service.client=no-auth
 management.port=8448
 management.endpoints.enabled-by-default=false
 management.security.enabled=false
-endpoints.enabled=false
-endpoints.info.enabled=false
-endpoints.prometheus.enabled=false
-endpoints.health.enabled=false
+endpoints.enabled={{ .Values.endpoints.enabled }}
+endpoints.info.enabled={{ .Values.endpoints.info.enabled }}
+endpoints.prometheus.enabled={{ .Values.metrics.serviceMonitor.enabled }}
+endpoints.health.enabled={{ .Values.endpoints.health.enabled }}
 management.metrics.web.server.auto-time-requests=false
 management.metrics.distribution.percentiles-histogram[http.server.requests]=true
 management.metrics.distribution.sla[http.server.requests]=20ms, 30ms, 40ms, 50ms, 60ms, 70ms, 80ms, 90ms, 100ms, 500ms, 1000ms, 5000ms, 7000ms
index 836dc7b..4835560 100644 (file)
@@ -90,7 +90,17 @@ log.tx.key-consistent={{ .Values.global.config.storage.keyConsistent }}
 {{ end }}
 
 storage.lock.wait-time=300
-# Setting db-cache to false ensure the fastest propagation of changes across servers
-cache.db-cache = false
+
+# https://docs.janusgraph.org/operations/cache/#database-level-caching
+# Setting db-cache to false will ensure the fastest propagation of changes across servers
+# Setting db-cache to true will ensure fastest response times
+cache.db-cache={{ .Values.config.janusgraph.caching.enabled }}
+{{ if .Values.config.janusgraph.caching.enabled }}
+# cache-time in milliseconds
+cache.db-cache-time={{ .Values.config.janusgraph.caching.dbCacheTime }}
+cache.db-cache-size={{ .Values.config.janusgraph.caching.dbCacheSize }}
+cache.db-cache-clean-wait={{ .Values.config.janusgraph.caching.dbCacheCleanWait }}
+{{ end }}
+
 #load graphson file on startup
 load.snapshot.file=false
index 6bcc0f8..ba0897e 100644 (file)
@@ -154,6 +154,18 @@ config:
     # to the user in keycloak
     multiTenancy:
       enabled: true
+  janusgraph:
+    caching:
+      # enable when running read-heavy workloads
+      # modifications to graph done by this service/janusgraph instance will immediately invalidate the cache
+      # modifications to graph done by other services (traversal) will only be visible
+      # after time specified in db-cache-time
+      enabled: false
+      # Documentation: https://docs.janusgraph.org/operations/cache/#database-level-caching
+      dbCacheTime: 180000 # in milliseconds
+      dbCacheSize: 0.1 # percentage (expressed as a decimal between 0 and 1) of the total heap space available to the JVM running
+      dbCacheCleanWait: 20 # in milliseconds
+
 
   # Specifies crud related operation timeouts and overrides
   crud:
@@ -259,6 +271,13 @@ tracing:
   ignorePatterns:
     - /aai/util.*
 
+endpoints:
+  enabled: true
+  health:
+    enabled: true
+  info:
+    enabled: true
+
 metrics:
   serviceMonitor:
     enabled: false
index caed645..67fefd2 100644 (file)
@@ -1,7 +1,7 @@
 {{/*
 # Copyright © 2018 Amdocs, Bell Canada, AT&T
 # Modifications Copyright © 2020 Orange
-# Modifications Copyright © 2023 Nordix Foundation
+# Modifications Copyright  2023 Nordix Foundation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -95,10 +95,10 @@ schema.service.client=no-auth
 management.port=8448
 management.endpoints.enabled-by-default=false
 management.security.enabled=false
-endpoints.enabled=false
-endpoints.info.enabled=false
-endpoints.prometheus.enabled=false
-endpoints.health.enabled=false
+endpoints.enabled={{ .Values.endpoints.enabled }}
+endpoints.info.enabled={{ .Values.endpoints.info.enabled }}
+endpoints.prometheus.enabled={{ .Values.metrics.serviceMonitor.enabled }}
+endpoints.health.enabled={{ .Values.endpoints.health.enabled }}
 management.metrics.web.server.auto-time-requests=false
 management.metrics.distribution.percentiles-histogram[http.server.requests]=true
 management.metrics.distribution.sla[http.server.requests]=20ms, 30ms, 40ms, 50ms, 60ms, 70ms, 80ms, 90ms, 100ms, 500ms, 1000ms, 5000ms, 7000ms
index 836dc7b..4835560 100644 (file)
@@ -90,7 +90,17 @@ log.tx.key-consistent={{ .Values.global.config.storage.keyConsistent }}
 {{ end }}
 
 storage.lock.wait-time=300
-# Setting db-cache to false ensure the fastest propagation of changes across servers
-cache.db-cache = false
+
+# https://docs.janusgraph.org/operations/cache/#database-level-caching
+# Setting db-cache to false will ensure the fastest propagation of changes across servers
+# Setting db-cache to true will ensure fastest response times
+cache.db-cache={{ .Values.config.janusgraph.caching.enabled }}
+{{ if .Values.config.janusgraph.caching.enabled }}
+# cache-time in milliseconds
+cache.db-cache-time={{ .Values.config.janusgraph.caching.dbCacheTime }}
+cache.db-cache-size={{ .Values.config.janusgraph.caching.dbCacheSize }}
+cache.db-cache-clean-wait={{ .Values.config.janusgraph.caching.dbCacheCleanWait }}
+{{ end }}
+
 #load graphson file on startup
 load.snapshot.file=false
index a3772d8..88f81e3 100644 (file)
@@ -142,7 +142,6 @@ aai_enpoints:
 
 # application configuration
 config:
-
   # configure keycloak according to your environment.
   # don't forget to add keycloak in active profiles above (global.config.profiles)
   keycloak:
@@ -156,6 +155,18 @@ config:
     # the data-owner property with the given role to the user in keycloak
     multiTenancy:
       enabled: true
+  janusgraph:
+    caching:
+      # enable when running read-heavy workloads
+      # modifications to graph done by this service/janusgraph instance will immediately invalidate the cache
+      # modifications to graph done by other services (resources) will only be visible
+      # after time specified in db-cache-time
+      enabled: false
+      # Documentation: https://docs.janusgraph.org/operations/cache/#database-level-caching
+      dbCacheTime: 180000 # in milliseconds
+      dbCacheSize: 0.1 # percentage (expressed as a decimal between 0 and 1) of the total heap space available to the JVM running
+      dbCacheCleanWait: 20 # in milliseconds
+
 
   # Specifies timeout information such as application specific and limits
   timeout:
@@ -272,6 +283,13 @@ resources:
       memory: 4Gi
   unlimited: {}
 
+endpoints:
+  enabled: true
+  health:
+    enabled: true
+  info:
+    enabled: true
+
 metrics:
   serviceMonitor:
     enabled: false