Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dashboard] Optimizing performance of Ray Dashboard #47617

Merged
merged 6 commits into from
Sep 19, 2024

Conversation

alexeykudinkin
Copy link
Contributor

Why are these changes needed?

  • Reduced & aligned intervals updating node's workers stats to 15s
  • Revisited node stats updating seq to poll raylets in chunks (of no more than 100 at a time)
  • Revisit ActorHead APIs to allow fetching individual actor w/o the need to process every actor ever-created
  • Remove singleton (single-threaded) TPE in both Head/Agents with standalone (single-threaded) TPEs in every Head/Agent
  • Added metrics for # of tasks running on Dashboard's EVL
  • Misc fixes

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

@alexeykudinkin alexeykudinkin added the go add ONLY when ready to merge, run all tests label Sep 12, 2024
@alexeykudinkin alexeykudinkin force-pushed the ak/dshb-perf-opt-fix branch 3 times, most recently from 583d244 to 35a7b4f Compare September 17, 2024 18:37
@@ -26,7 +26,7 @@
"RAY_DASHBOARD_STATS_PURGING_INTERVAL", 60 * 10
)
RAY_DASHBOARD_STATS_UPDATING_INTERVAL = env_integer(
"RAY_DASHBOARD_STATS_UPDATING_INTERVAL", 2
"RAY_DASHBOARD_STATS_UPDATING_INTERVAL", 15
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alanwguo if we want to preserve UI update frequency to 2s we'll need to switch to pulling model in the UI

Copy link
Contributor

Choose a reason for hiding this comment

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

I think 15s is probably fine.

@@ -26,7 +26,7 @@
"RAY_DASHBOARD_STATS_PURGING_INTERVAL", 60 * 10
)
RAY_DASHBOARD_STATS_UPDATING_INTERVAL = env_integer(
"RAY_DASHBOARD_STATS_UPDATING_INTERVAL", 2
"RAY_DASHBOARD_STATS_UPDATING_INTERVAL", 15
Copy link
Contributor

Choose a reason for hiding this comment

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

I think 15s is probably fine.

Signed-off-by: Alexey Kudinkin <ak@anyscale.com>
Signed-off-by: Alexey Kudinkin <ak@anyscale.com>
Signed-off-by: Alexey Kudinkin <ak@anyscale.com>
Signed-off-by: Alexey Kudinkin <ak@anyscale.com>
@alexeykudinkin
Copy link
Contributor Author

For those who might run into this in the future: CI is failing b/c i'm adding module named collections which apparently (based on just the filename) collides with system one (sic!)

/rayci/python/ray/_private/log_monitor.py:26: SyntaxWarning: invalid escape sequence '\d'
/rayci/python/ray/_private/log_monitor.py:28: SyntaxWarning: invalid escape sequence '\d'
Traceback (most recent call last):
  File "/rayci/python/ray/_private/log_monitor.py", line 1, in <module>
    import argparse
  File "/opt/miniconda/lib/python3.12/argparse.py", line 89, in <module>
    import re as _re
  File "/opt/miniconda/lib/python3.12/re/__init__.py", line 124, in <module>
    import enum
  File "/opt/miniconda/lib/python3.12/enum.py", line 5, in <module>
    from functools import reduce
  File "/opt/miniconda/lib/python3.12/functools.py", line 18, in <module>
    from collections import namedtuple
  File "/rayci/python/ray/_private/collections.py", line 1, in <module>
    from typing import List, Any
  File "/opt/miniconda/lib/python3.12/typing.py", line 24, in <module>
    from collections import defaultdict
ImportError: cannot import name 'defaultdict' from partially initialized module 'collections' (most likely due to a circular import) (/rayci/python/ray/_private/collections.py)

Signed-off-by: Alexey Kudinkin <ak@anyscale.com>
Signed-off-by: Alexey Kudinkin <ak@anyscale.com>
@jjyao jjyao merged commit b0828fb into ray-project:master Sep 19, 2024
5 checks passed
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
Signed-off-by: Alexey Kudinkin <ak@anyscale.com>
Signed-off-by: ujjawal-khare <ujjawal.khare@dream11.com>
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
Signed-off-by: Alexey Kudinkin <ak@anyscale.com>
Signed-off-by: ujjawal-khare <ujjawal.khare@dream11.com>
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
Signed-off-by: Alexey Kudinkin <ak@anyscale.com>
Signed-off-by: ujjawal-khare <ujjawal.khare@dream11.com>
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
Signed-off-by: Alexey Kudinkin <ak@anyscale.com>
Signed-off-by: ujjawal-khare <ujjawal.khare@dream11.com>
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
Signed-off-by: Alexey Kudinkin <ak@anyscale.com>
Signed-off-by: ujjawal-khare <ujjawal.khare@dream11.com>
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
Signed-off-by: Alexey Kudinkin <ak@anyscale.com>
Signed-off-by: ujjawal-khare <ujjawal.khare@dream11.com>
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
Signed-off-by: Alexey Kudinkin <ak@anyscale.com>
Signed-off-by: ujjawal-khare <ujjawal.khare@dream11.com>
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
Signed-off-by: Alexey Kudinkin <ak@anyscale.com>
Signed-off-by: ujjawal-khare <ujjawal.khare@dream11.com>
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
Signed-off-by: Alexey Kudinkin <ak@anyscale.com>
Signed-off-by: ujjawal-khare <ujjawal.khare@dream11.com>
@yx367563
Copy link

Hi, I can often see the following error reported in dashboard.log after upgrading to 2.38.0, and I see that blame is related to this pr, and wanted to ask if it's as expected. @alexeykudinkin

2024-11-14 17:51:39,108 ERROR utils.py:570 -- Error looping coroutine <function NodeHead._update_node_stats at 0x7f8c72d53a30>.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/ray/dashboard/utils.py", line 557, in _looper
    await coro(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/ray/dashboard/modules/node/node_head.py", line 519, in _update_node_stats
    assert len(node_ids) == len(responses)
AssertionError

@jjyao
Copy link
Collaborator

jjyao commented Nov 14, 2024

@yx367563 I'm able to reproduce it and let me put up a fix really quick.

@yx367563
Copy link

yx367563 commented Nov 15, 2024

@jjyao Please let me know after the fix is ​​completed. I found that after upgrading to Ray 2.38.0, I can no longer get the relevant information of DataSource.nodes in state_manager like DataSource.nodes[node_id]["nodeName"]/DataSource.nodes[node_id]["nodeManagerHostName"]. Is this related to this problem?

@jjyao
Copy link
Collaborator

jjyao commented Nov 15, 2024

It's just fixed in master.

@yx367563
Copy link

@jjyao Thank you! Could you help me to see why can no longer get the relevant information of DataSource.nodes in state_manager like DataSource.nodes[node_id]["nodeName"]/DataSource.nodes[node_id]["nodeManagerHostName"]. Because it's still can get this data in ray 2.23.0

@yx367563
Copy link

@jjyao For now, it just:

state_manager.py:609 -- state_manager.py: node_info: ImmutableDict({'nodeId': '2996d83891c64ae58fcd1ece16dd9a3f4157fda71b6d550e04f1968f', 'state': 'DEAD', 'endTimeMs': '1731633619551', 'deathInfo': {'reason': 'EXPECTED_TERMINATION', 'reasonMessage': 'received SIGTERM'}, 'nodeManagerAddress': '', 'rayletSocketName': '', 'objectStoreSocketName': '', 'nodeManagerPort': 0, 'objectManagerPort': 0, 'nodeManagerHostname': '', 'metricsExportPort': 0, 'runtimeEnvAgentPort': 0, 'resourcesTotal': {}, 'nodeName': '', 'instanceId': '', 'nodeTypeName': '', 'instanceTypeName': '', 'startTimeMs': '0', 'isHeadNode': False, 'labels': {}})

You can see that the following data are all invalid data

@yx367563
Copy link

It seems you've erased all this information after the node's death.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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