From e27c00154708984e2726cc74c764d3df452cb914 Mon Sep 17 00:00:00 2001 From: addshore Date: Sun, 27 Sep 2026 23:46:17 +0100 Subject: [PATCH] Make queryservice memory and probe settings configurable Expose the existing JVM MaxRAM value and an optional MaxDirectMemorySize limit so environments can tune memory without changing the image. Add an optional startup probe and configurable HTTP probe timeouts to accommodate slower local startup and responses. Preserve existing defaults: MaxRAM=2g, no explicit direct-memory limit, no startup probe, and one-second HTTP probe timeouts. All probes remain controlled by useProbes. Leave the image write-cache configuration unchanged, as the change is more complex, even though this would also give local development some more gains, perhaps might folloup with that. --- charts/queryservice/Chart.yaml | 2 +- charts/queryservice/README.md | 12 ++++++++++++ charts/queryservice/templates/deployment.yaml | 10 +++++++--- charts/queryservice/values.yaml | 4 ++++ 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/charts/queryservice/Chart.yaml b/charts/queryservice/Chart.yaml index caca4b4d..9258ffe1 100644 --- a/charts/queryservice/Chart.yaml +++ b/charts/queryservice/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "1.0" description: A Helm chart for Kubernetes name: queryservice -version: 0.2.1 +version: 0.2.4 home: https://github.com/wbstack maintainers: - name: WBstack diff --git a/charts/queryservice/README.md b/charts/queryservice/README.md index 36a26a4a..e0edb35b 100644 --- a/charts/queryservice/README.md +++ b/charts/queryservice/README.md @@ -1,7 +1,19 @@ # wbstack queryservice +## Settings + +Existing memory and probe defaults are preserved unless overridden. + +| Value | Default | Description | +| --- | --- | --- | +| `app.maxRam` | `2g` | JVM `-XX:MaxRAM`; not a total process-memory limit. | +| `app.maxDirectMemorySize` | `""` | Optional JVM `-XX:MaxDirectMemorySize` limit. | +| `startupProbe` | `{}` | Optional Kubernetes startup probe, applied only when `useProbes` is enabled. | +| `probeTimeoutSeconds` | `1` | Timeout for the HTTP liveness and readiness probes. | + ## Changelog +- 0.2.4: Make JVM memory limits and startup/probe settings configurable while preserving existing defaults. - 0.2.0: Switch to ingress API version to GA v1 from v1beta1 - 0.1.3: Change service from `NodePort` to `ClusterIP` - 0.1.2: Change image pullPolicy values to `IfNotPresent` diff --git a/charts/queryservice/templates/deployment.yaml b/charts/queryservice/templates/deployment.yaml index df7dcfa1..a088282d 100644 --- a/charts/queryservice/templates/deployment.yaml +++ b/charts/queryservice/templates/deployment.yaml @@ -39,20 +39,24 @@ spec: containerPort: 9999 protocol: TCP {{- if .Values.useProbes }} + {{- with .Values.startupProbe }} + startupProbe: + {{- toYaml . | nindent 12 }} + {{- end }} livenessProbe: httpGet: path: /bigdata/ port: http # wdqs can take some time on initial boot, so take that into account initialDelaySeconds: 30 - timeoutSeconds: 1 + timeoutSeconds: {{ .Values.probeTimeoutSeconds }} periodSeconds: 15 readinessProbe: httpGet: path: /bigdata/ port: http initialDelaySeconds: 15 - timeoutSeconds: 1 + timeoutSeconds: {{ .Values.probeTimeoutSeconds }} periodSeconds: 15 {{- end }} resources: @@ -64,7 +68,7 @@ spec: value: {{ .Values.app.heapSize }} # TODO would use -XX:+UseSerialGC but conflicts with -XX:+UseG1GC in runBlazegraph.sh - name: EXTRA_JVM_OPTS - value: "-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:MaxRAM=2g -XX:+TieredCompilation -XX:TieredStopAtLevel=1" + value: "-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:MaxRAM={{ .Values.app.maxRam }}{{ if .Values.app.maxDirectMemorySize }} -XX:MaxDirectMemorySize={{ .Values.app.maxDirectMemorySize }}{{ end }} -XX:+TieredCompilation -XX:TieredStopAtLevel=1" - name: GC_LOGS value: " " #TODO allow passing value in values diff --git a/charts/queryservice/values.yaml b/charts/queryservice/values.yaml index fab22909..cc286977 100644 --- a/charts/queryservice/values.yaml +++ b/charts/queryservice/values.yaml @@ -4,6 +4,8 @@ replicaCount: 1 useProbes: true +startupProbe: {} +probeTimeoutSeconds: 1 image: repository: ghcr.io/wbstack/queryservice @@ -12,6 +14,8 @@ image: app: heapSize: 2g + maxRam: 2g + maxDirectMemorySize: "" imagePullSecrets: [] nameOverride: ""