Skip to content

[core] Warn about worker gRPC threads on high-CPU nodes - #65637

Merged
richardliaw merged 4 commits into
ray-project:masterfrom
OneSizeFitsQuorum:OneSizeFitsQuorum/core-data-coreworker-discussion-remaining-grpc-t
Aug 31, 2026
Merged

richardliaw merged 4 commits into
ray-project:masterfrom
OneSizeFitsQuorum:OneSizeFitsQuorum/core-data-coreworker-discussion-remaining-grpc-t

Conversation

@OneSizeFitsQuorum

@OneSizeFitsQuorum OneSizeFitsQuorum commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Description

Each Ray worker process has its own gRPC runtime, so high-worker-density nodes can accumulate a large number of gRPC threads. Maintainers decided not to change the default worker_num_grpc_internal_threads value because that could be breaking.

This PR implements the non-breaking follow-up requested in #64834:

  • Log a raylet warning when the node has more than 16 detected CPUs and RAY_worker_num_grpc_internal_threads is not set to a positive value.
  • Document how to configure the worker gRPC thread setting on Ray nodes.
  • Add a dedicated troubleshooting guide for inspecting worker threads, distinguishing a separately loaded Python grpcio runtime, and checking process and thread limits.
  • Add unit coverage for the threshold boundary, warning text, and explicit-configuration behavior.

The worker gRPC thread default and runtime sizing behavior are unchanged.

Related issues

Related to #64834.

Additional information

Duplicate-work check

I reviewed the issue discussion and searched open PRs by issue number and worker gRPC warning/documentation keywords before opening this PR. The only related open PR is #64898, which covers CPU-limit-based default selection and its tests. It does not implement the maintainer-requested warning or documentation, and this PR deliberately leaves the default unchanged.

Testing

  • bazel build //src/ray/raylet:raylet — passed.
  • bazel test //src/ray/raylet/tests:worker_pool_test --test_output=errors — passed (1/1 test target).
  • pre-commit run with pre-commit 3.5.0 — passed, including cpplint, clang-format, semgrep, and core C++ inclusion checks.
  • python doc/test_no_new_rst.py --base master --remote origin --commit HEAD — passed.
  • MyST front matter, code fences, toctree entry, and cross-reference consistency check — passed.
  • git diff --check — passed.

AI assistance

AI assistance was used to trace the relevant code path, draft the implementation, tests, and documentation, and run validation. The human submitter reviewed every changed line and understands and can defend the change end-to-end.

@OneSizeFitsQuorum
OneSizeFitsQuorum requested review from a team as code owners August 21, 2026 04:07

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a warning mechanism when Ray is run on high-CPU nodes (with more than 32 CPUs) without configuring the RAY_worker_num_grpc_internal_threads environment variable. It includes the implementation of GetWorkerGrpcThreadsWarning in the worker pool, integration into the Raylet main entry point, corresponding unit tests, and comprehensive documentation explaining how to configure and troubleshoot worker gRPC threads. There are no review comments, and I have no feedback to provide.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 952504a. Configure here.

Comment thread src/ray/raylet/worker_pool.h Resolved
@ray-gardener ray-gardener Bot added docs An issue or change related to documentation core Issues that should be addressed in Ray Core community-contribution Contributed by the community labels Aug 21, 2026
@MortalHappiness MortalHappiness self-assigned this Aug 21, 2026
Comment thread src/ray/raylet/worker_pool.h Resolved
Comment thread src/ray/raylet/main.cc Resolved
Comment thread src/ray/raylet/worker_pool.cc Resolved
Comment thread doc/source/ray-core/configure.rst Resolved
Comment thread doc/source/ray-core/configure.rst Resolved
Comment thread doc/source/ray-core/configure.rst Resolved
Comment thread doc/source/ray-core/configure.rst Resolved
Comment thread doc/source/ray-core/configure.rst Resolved
@OneSizeFitsQuorum
OneSizeFitsQuorum requested review from a team as code owners August 24, 2026 04:08
@richardliaw richardliaw added the go add ONLY when ready to merge, run all tests label Aug 31, 2026
@richardliaw
richardliaw enabled auto-merge (squash) August 31, 2026 17:06
@richardliaw
richardliaw merged commit 25ed378 into ray-project:master Aug 31, 2026
8 checks passed
@OneSizeFitsQuorum
OneSizeFitsQuorum deleted the OneSizeFitsQuorum/core-data-coreworker-discussion-remaining-grpc-t branch September 1, 2026 01:52
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
…65637)

## Description

Each Ray worker process has its own gRPC runtime, so high-worker-density
nodes can accumulate a large number of gRPC threads. Maintainers decided
not to change the default `worker_num_grpc_internal_threads` value
because that could be breaking.

This PR implements the non-breaking follow-up requested in ray-project#64834:

- Log a raylet warning when the node has more than 16 detected CPUs and
`RAY_worker_num_grpc_internal_threads` is not set to a positive value.
- Document how to configure the worker gRPC thread setting on Ray nodes.
- Add a dedicated troubleshooting guide for inspecting worker threads,
distinguishing a separately loaded Python `grpcio` runtime, and checking
process and thread limits.
- Add unit coverage for the threshold boundary, warning text, and
explicit-configuration behavior.

The worker gRPC thread default and runtime sizing behavior are
unchanged.

## Related issues

Related to ray-project#64834.

## Additional information

### Duplicate-work check

I reviewed the issue discussion and searched open PRs by issue number
and worker gRPC warning/documentation keywords before opening this PR.
The only related open PR is ray-project#64898, which covers CPU-limit-based default
selection and its tests. It does not implement the maintainer-requested
warning or documentation, and this PR deliberately leaves the default
unchanged.

### Testing

- `bazel build //src/ray/raylet:raylet` — passed.
- `bazel test //src/ray/raylet/tests:worker_pool_test
--test_output=errors` — passed (1/1 test target).
- `pre-commit run` with pre-commit 3.5.0 — passed, including cpplint,
clang-format, semgrep, and core C++ inclusion checks.
- `python doc/test_no_new_rst.py --base master --remote origin --commit
HEAD` — passed.
- MyST front matter, code fences, toctree entry, and cross-reference
consistency check — passed.
- `git diff --check` — passed.

### AI assistance

AI assistance was used to trace the relevant code path, draft the
implementation, tests, and documentation, and run validation. The human
submitter reviewed every changed line and understands and can defend the
change end-to-end.

---------

Signed-off-by: OneSizeFitsQuorum <[email protected]>
Co-authored-by: Douglas Strodtman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Contributed by the community core Issues that should be addressed in Ray Core docs An issue or change related to documentation go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants