Skip to content

Commit 1d3fde9

Browse files
jensfrclaude
andcommitted
feat: add configurable worker_count for KBS HTTP server
The KBS uses actix-web, which defaults to one HTTP worker thread per logical CPU core (std::thread::available_parallelism). On high-core- count systems (e.g., 160-core AMD EPYC 9845 with 320 threads), this creates hundreds of workers that exceed the container's default nofile ulimit (1024/2048 in CRI-O), causing the KBS to crash on startup with "Too many open files". Add an optional kbs.workerCount Helm value that maps to the worker_count field in the KBS [http_server] config section. When set, the KBS uses the specified number of workers instead of auto-detecting. When unset, the existing behavior is preserved. The KBS binary already supports worker_count in its config (kbs/src/config.rs:41, kbs/src/api_server.rs:145-147 in openshift/ trustee v1.1.0) but the Helm chart did not expose it. Signed-off-by: Jens Freimann <jfreiman@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ebde8b7 commit 1d3fde9

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

templates/kbs-config-map.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ data:
99
kbs-config.toml: |
1010
[http_server]
1111
sockets = ["0.0.0.0:8080"]
12+
{{- if .Values.kbs.workerCount }}
13+
worker_count = {{ .Values.kbs.workerCount }}
14+
{{- end }}
1215
insecure_http = false
1316
private_key = "/etc/https-key/tls.key"
1417
certificate = "/etc/https-cert/tls.crt"

values.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ kbs:
4848
# exist in the trustee-operator-system namespace.
4949
extraSecrets: []
5050

51+
# Number of HTTP worker threads for the KBS server.
52+
# If unset, the KBS binary defaults to one worker per logical CPU core,
53+
# which can cause "too many open files" crashes on high-core-count systems
54+
# where the container's nofile ulimit is lower than the worker count.
55+
# Set this to a reasonable value (e.g., 4-8) on systems with many cores.
56+
# workerCount: 4
57+
5158
# NVIDIA GPU confidential computing configuration
5259
gpu:
5360
enabled: false

0 commit comments

Comments
 (0)