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

Implement tracing and CPU profiling of long running block creations [NIT-2501] #2305

Merged
merged 10 commits into from
May 24, 2024

Conversation

anodar
Copy link
Contributor

@anodar anodar commented May 15, 2024

No description provided.

@cla-bot cla-bot bot added the s Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA. label May 15, 2024
@anodar anodar changed the title Implement tracing and CPU profiling of long running block creations Implement tracing and CPU profiling of long running block creations [NIT-2501] May 15, 2024
@anodar anodar requested a review from PlasmaPower May 15, 2024 14:01
@anodar anodar marked this pull request as ready for review May 15, 2024 14:01
@joshuacolvin0 joshuacolvin0 requested a review from magicxyyz May 15, 2024 19:54
Copy link
Contributor

@magicxyyz magicxyyz left a comment

Choose a reason for hiding this comment

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

looks good, added few comments with potential improvements

execution/gethexec/sequencer.go Outdated Show resolved Hide resolved
execution/gethexec/sequencer.go Outdated Show resolved Hide resolved
execution/gethexec/sequencer.go Outdated Show resolved Hide resolved
pprof.StopCPUProfile()
trace.Stop()
closeFiles(pprofFile, traceFile)
if elapsed > 5*time.Second {
Copy link
Contributor

Choose a reason for hiding this comment

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

does it make sense to make the time threshold configurable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have similar argument here as above, this is just for debugging why do some queries take long time. (Just like in existing code:

if elapsed >= time.Second*5 {
)

My reasoning in this case for not having configurable is that I believe we already have too many flags, majority of which never actually varies. I'm hesitant to add another one like that, unless we have a good reason.

In any case, if you see more value in that, happy to make it configurable.

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense, but I wander if 5 seconds for block creation isn't too high threshold.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Discussed with Lee, he suggested 2 seconds and I've changed to that.

execution/gethexec/sequencer.go Outdated Show resolved Hide resolved
execution/gethexec/sequencer.go Show resolved Hide resolved
@anodar anodar requested a review from magicxyyz May 22, 2024 14:49
magicxyyz
magicxyyz previously approved these changes May 23, 2024
Copy link
Contributor

@magicxyyz magicxyyz left a comment

Choose a reason for hiding this comment

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

LGTM

pprof.StopCPUProfile()
trace.Stop()
closeFiles(pprofFile, traceFile)
if elapsed > 5*time.Second {
Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense, but I wander if 5 seconds for block creation isn't too high threshold.

execution/gethexec/sequencer.go Show resolved Hide resolved
execution/gethexec/sequencer.go Outdated Show resolved Hide resolved
execution/gethexec/sequencer.go Outdated Show resolved Hide resolved
Copy link
Contributor

@magicxyyz magicxyyz left a comment

Choose a reason for hiding this comment

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

LGTM

@anodar anodar merged commit 917f828 into master May 24, 2024
10 checks passed
@anodar anodar deleted the block-creation-profiling branch May 24, 2024 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants