Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Add embedded Go pprof and DataDog profilers #366

Merged
merged 4 commits into from
Jun 4, 2024
Merged

Add embedded Go pprof and DataDog profilers #366

merged 4 commits into from
Jun 4, 2024

Conversation

rdmitr
Copy link
Collaborator

@rdmitr rdmitr commented Jun 1, 2024

This PR replaces #320 β€” I got linter errors when trying to merge and commit, so I figured it was easier to ditch it and create a new one πŸ˜…

@rdmitr
Copy link
Collaborator Author

rdmitr commented Jun 1, 2024

@bumi in the original PR, you have removed all the env configuration variables except DD_PROFILER_AGENT_ADDR. I am a bit confused β€” was it intended?.. Agent address can be specified using an env variable just like the other DataDog settings, so in this PR I have added DD_PROFILER_ENABLED flag instead.

@rdmitr rdmitr requested review from bumi and rolznz June 1, 2024 21:13
@rolznz
Copy link
Collaborator

rolznz commented Jun 2, 2024

@rdmitr do you remember the linter errors you got? we merged some linter changes but it should have only affected the frontend code, not the go code.

@bumi
Copy link

bumi commented Jun 2, 2024

@rdmitr makes sense. thanks

@rdmitr
Copy link
Collaborator Author

rdmitr commented Jun 3, 2024

@rolznz

do you remember the linter errors you got? we merged some linter changes but it should have only affected the frontend code, not the go code.

Not really β€” I think some of the commit names were not formatted as expected by husky, and then it screwed up the merge and conflict resolution process in my IDE. I decided not to waste time trying to figure it out.

But the husky rules certainly apply to the whole repo β€” I was quite surprised on Saturday when my commits suddenly started failing 😁

@rolznz
Copy link
Collaborator

rolznz commented Jun 4, 2024

@rdmitr do you understand what this part is caused by?

image

Can we conclude that LDK consumes about 4X as much resources as our NWC code and our main two things that cause high CPU usage are Nostr event handling and DB access?

image

Copy link
Collaborator

@rolznz rolznz left a comment

Choose a reason for hiding this comment

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

tACK for pprof.

We still need to deploy a datadog agent and enable profiling on some of our running hub instances.

@rolznz rolznz merged commit 100a09d into master Jun 4, 2024
3 checks passed
@rolznz rolznz deleted the profiler2 branch June 4, 2024 09:45
reneaaron pushed a commit that referenced this pull request Jun 5, 2024
Co-authored-by: Roman Dmitrienko <roman@dmitrienko.com>
Co-authored-by: Roland Bewick <roland.bewick@gmail.com>
@rdmitr
Copy link
Collaborator Author

rdmitr commented Jun 5, 2024

@rolznz

do you understand what this part is caused by?

As far as I understand, that's goroutine management code

Can we conclude that LDK consumes about 4X as much resources as our NWC code and our main two things that cause high CPU usage are Nostr event handling and DB access?

It looks like the profile was collected over a fairly short amount of time, so it's hard to say for sure. But yes, I would expect LDK code to be quite resource intensive

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants