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

[core] Record dashboard metrics with oneshot #51627

Merged
merged 3 commits into from
Mar 25, 2025

Conversation

dayshah
Copy link
Contributor

@dayshah dayshah commented Mar 23, 2025

Why are these changes needed?

While looking at a dashboard flame graph, memory_full_info was actually visible even though it only runs every 5 seconds. Our two calls mean we're getting the info twice so even more expensive, and it can also result in inconsistent info between uss and rss. We also get an additional speedup by using with oneshot() with getting cpu percent as well. https://psutil.readthedocs.io/en/latest/#psutil.Process.oneshot.

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 :(

Signed-off-by: dayshah <dhyey2019@gmail.com>
Signed-off-by: dayshah <dhyey2019@gmail.com>
@dayshah dayshah added the go add ONLY when ready to merge, run all tests label Mar 23, 2025
@dayshah dayshah requested a review from edoakes March 23, 2025 01:33
@edoakes
Copy link
Collaborator

edoakes commented Mar 24, 2025

Very nice! Did you sanity check the flamegraph after the change?

@dayshah
Copy link
Contributor Author

dayshah commented Mar 24, 2025

Very nice! Did you sanity check the flamegraph after the change?

sanity checked now, 2.8% -> 1.6%.

Copy link
Contributor

@dentiny dentiny left a comment

Choose a reason for hiding this comment

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

Nice!

@edoakes edoakes merged commit 10c8a65 into ray-project:master Mar 25, 2025
5 checks passed
@dayshah dayshah deleted the dashboard-ps-imp branch March 25, 2025 21:11
angelinalg pushed a commit to angelinalg/ray that referenced this pull request Mar 26, 2025
While looking at a dashboard flame graph, memory_full_info was actually
visible even though it only runs every 5 seconds. Our two calls mean
we're getting the info twice so even more expensive, and it can also
result in inconsistent info between uss and rss. We also get an
additional speedup by using with oneshot() with getting cpu percent as
well. https://psutil.readthedocs.io/en/latest/#psutil.Process.oneshot.

---------

Signed-off-by: dayshah <dhyey2019@gmail.com>
dhakshin32 pushed a commit to dhakshin32/ray that referenced this pull request Mar 27, 2025
While looking at a dashboard flame graph, memory_full_info was actually
visible even though it only runs every 5 seconds. Our two calls mean
we're getting the info twice so even more expensive, and it can also
result in inconsistent info between uss and rss. We also get an
additional speedup by using with oneshot() with getting cpu percent as
well. https://psutil.readthedocs.io/en/latest/#psutil.Process.oneshot.

---------

Signed-off-by: dayshah <dhyey2019@gmail.com>
Signed-off-by: Dhakshin Suriakannu <d_suriakannu@apple.com>
d-miketa pushed a commit to d-miketa/ray that referenced this pull request Mar 28, 2025
While looking at a dashboard flame graph, memory_full_info was actually
visible even though it only runs every 5 seconds. Our two calls mean
we're getting the info twice so even more expensive, and it can also
result in inconsistent info between uss and rss. We also get an
additional speedup by using with oneshot() with getting cpu percent as
well. https://psutil.readthedocs.io/en/latest/#psutil.Process.oneshot.

---------

Signed-off-by: dayshah <dhyey2019@gmail.com>
srinathk10 pushed a commit that referenced this pull request Mar 28, 2025
While looking at a dashboard flame graph, memory_full_info was actually
visible even though it only runs every 5 seconds. Our two calls mean
we're getting the info twice so even more expensive, and it can also
result in inconsistent info between uss and rss. We also get an
additional speedup by using with oneshot() with getting cpu percent as
well. https://psutil.readthedocs.io/en/latest/#psutil.Process.oneshot.

---------

Signed-off-by: dayshah <dhyey2019@gmail.com>
Signed-off-by: Srinath Krishnamachari <srinath.krishnamachari@anyscale.com>
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.

3 participants