feat: add configurable worker_count for KBS HTTP server#24
Open
jensfr wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On high-core-count systems (e.g., 160-core AMD EPYC 9845 with 320 logical threads), the KBS crashes on startup with "Too many open files".
The KBS uses actix-web, which defaults to one HTTP worker thread per logical CPU core (
std::thread::available_parallelism()). With 320 threads, this creates 512 workers that exceed the container's default nofile ulimit (1024 soft / 2048 hard in CRI-O).Fix
Add an optional
kbs.workerCountHelm value that maps to theworker_countfield in the KBS[http_server]config section. The KBS binary already supports this field (kbs/src/config.rs:41andkbs/src/api_server.rs:145-147in openshift/trustee v1.1.0), but the chart did not expose it.When set, the KBS uses the specified number of workers. When unset, the existing auto-detection behavior is preserved, maintaining backward compatibility for systems where the default works.
Usage
Test plan
worker_count = 4workerCountpreserves existing behaviorstarting 4 workerswhen set🤖 Generated with Claude Code