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

Random Thread Sampling on Wall Profiling #871

Closed
tanjh0421 opened this issue Dec 28, 2023 · 3 comments
Closed

Random Thread Sampling on Wall Profiling #871

tanjh0421 opened this issue Dec 28, 2023 · 3 comments
Labels

Comments

@tanjh0421
Copy link

Can a random sampling capacity (such as the datadog) be added to wall collector and an interface be added to obtain the sampling frequency?

@apangin
Copy link
Collaborator

apangin commented Dec 28, 2023

If you would like to contribute a new async-profiler feature, I suggest you first describe the problem, provide real-life examples on how the proposed feature addresses this problem, and outline the implementation approach.

@tanjh0421
Copy link
Author

tanjh0421 commented Dec 29, 2023

The current wall profile sends SIGVTALRM signals to all threads. Even if the minimum interval is limited, the CPU usage increases too high.
I see that Datadog uses a reservoir sampling algorithm to signal only some threads. However, such data is incomplete. To ensure that the data conforms to the actual situation as much as possible, the random rate can be reported at the same time to facilitate the user to calculate the expected value.

@apangin
Copy link
Collaborator

apangin commented Jan 1, 2024

If the problem you're concerned about is the high overhead of wall-clock sampling with many threads, I have a better idea on how to deal with that. It'll be likely implemented in one of the next versions. Otherwise, I'm open to proposals, bug reports, contributions and pull requests.

@apangin apangin closed this as not planned Won't fix, can't repro, duplicate, stale Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants