-
Notifications
You must be signed in to change notification settings - Fork 90
Enable Memory & CPU Profiling for df_engine #2420
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
Changes from 43 commits
c294b16
062e1fb
f79dffd
1ab21be
8c6daa6
d23af0e
ad71e6b
7482d31
aebde81
cc9e748
9222922
6568f0d
a87c8fe
157f5ab
d73b21e
eed136f
34c417c
0ad845f
30b679a
a7c9240
12b6ba4
6e77031
37891c6
d95c7b7
b46664d
bba7248
64f7ec7
2af5ef7
8c9801b
7c28e45
3897c66
1720c5f
72377fb
42c08f2
6d6b315
8856edc
d9e0bfd
66f02a4
a9186cc
e533701
0358fa0
06111a1
ebdf8d4
cd8bf90
1b4185f
600d336
a6dad10
658e151
285883f
787bfa5
7c81041
7d2a092
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,57 @@ | ||||||
| # Profiling | ||||||
|
sapatrjv marked this conversation as resolved.
|
||||||
|
|
||||||
| This section covers CPU and memory profiling for `df_engine`. | ||||||
|
|
||||||
| **Requirements**: | ||||||
|
|
||||||
| - [samply] (https://github.com/mstange/samply) | ||||||
|
Check failure on line 7 in rust/otap-dataflow/PROFILING.md
|
||||||
|
|
||||||
| **Installation**: | ||||||
|
|
||||||
| ```cmd/pwsh/bash | ||||||
| cargo install --locked samply | ||||||
| ``` | ||||||
|
|
||||||
| **Build**: | ||||||
|
|
||||||
| **Build for both CPU and memory profiling**: | ||||||
|
|
||||||
| ```cmd/pwsh/bash | ||||||
| cargo build --profile profiling --no-default-features --features dhat-heap --workspace | ||||||
| ``` | ||||||
|
|
||||||
| > [!NOTE] | ||||||
| > In this command, all default features are disabled. | ||||||
| > Use specific flags to enable individual features. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sapatrjv which one should we use?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
and what's your take?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In my opinion, both approaches will work in this scenario. It will differ when a sentence needs to appear on a separate line. In this case add a blank line with |
||||||
|
|
||||||
| **Build for only CPU profiling**: | ||||||
|
|
||||||
| ```cmd/pwsh/bash | ||||||
| cargo build --profile profiling --workspace | ||||||
| ``` | ||||||
|
|
||||||
| **Run**: | ||||||
|
|
||||||
| **Run with both CPU and memory profiling enabled**: | ||||||
|
|
||||||
| ```pwsh/bash | ||||||
| samply record ./target/profiling/df_engine --config ./configs/otap-noop.yaml | ||||||
| ``` | ||||||
|
|
||||||
| **Run with only memory profiling enabled**: | ||||||
|
|
||||||
| ```pwsh/bash | ||||||
| ./target/profiling/df_engine --config ./configs/otap-noop.yaml | ||||||
| ``` | ||||||
|
|
||||||
| **Result**: | ||||||
|
|
||||||
| On graceful shutdown of `df_engine`, it will generate `dhat-heap.json` file | ||||||
| for memory profiling that needs to be rendered by uploading it to: | ||||||
| <https://nnethercote.github.io/dh_view/>. | ||||||
|
|
||||||
| CPU profiling output will be automatically rendered on browser. | ||||||
|
|
||||||
| > [!NOTE] | ||||||
| > `dhat` needs a clean shutdown to generate `dhat-heap.json` file. | ||||||
|
Check failure on line 56 in rust/otap-dataflow/PROFILING.md
|
||||||
| > In `df_engine` this can be done manually with Ctrl+C. | ||||||
|
jmacd marked this conversation as resolved.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does Ctrl+C do a clean shutdown? The engine is not yet configured to react to it...
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does not handle clean shutdown with Ctrl+C. Here is PR #2325 that you own to handle it.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Until that PR (or another PR which adds this) is merged, lets not mention that engine can do clean shutdown with Ctrl+C |
||||||



Uh oh!
There was an error while loading. Please reload this page.