-
Notifications
You must be signed in to change notification settings - Fork 1k
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
kad: Kademlia::address_failed() periodically using a lot of CPU #3498
Comments
Thanks for the report. How many peers are you connected to? |
~30 ± a few |
That def sounds like a bug then. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Any chance you can run a flamegraph and share it here? |
I have to close this for now. After changes in the app the issue was gone. It was either due to code inlining in the compiler and the issue wasn't in libp2p all the way or it was triggered under specific conditions I am no longer able to reproduce. I'll reopen with more details if/when I can reproduce it again. |
Summary
I don't have a clean reproduction for this, but in short I'm getting ~100% usage by libp2p networking thread at times and every time I pause in debugger I get a backtrace that looks like this:
Clearly it is spending way too much time in
address_failed
, but why?I was trying to narrow it down and applied following patch to libp2p sources:
Turns out it does spend quite a bit of time there and iterates over non-negligible number of entries over and over again:
way-too-much.txt
It takes quite a few seconds and then goes back to normal just to repeat in a minute or so.
Possible Solution
Not sure yet
Version
https://github.com/subspace/rust-libp2p/tree/subspace-v5, which is fairly recent
master
branch with #3468 and #3474 added on top.Would you like to work on fixing this bug?
Yes
The text was updated successfully, but these errors were encountered: